@@ -15,12 +15,16 @@ Create a `SqlBrite` instance which is an adapter for the library functionality.
1515SqlBrite sqlBrite = SqlBrite . create();
1616```
1717
18- Pass a ` SQLiteOpenHelper ` instance to create a ` BriteDatabase ` .
18+ Pass a ` SQLiteOpenHelper ` instance and a ` Scheduler ` to create a ` BriteDatabase ` .
1919
2020``` java
21- BriteDatabase db = sqlBrite. wrapDatabaseHelper(openHelper);
21+ BriteDatabase db = sqlBrite. wrapDatabaseHelper(openHelper, Schedulers . io() );
2222```
2323
24+ A ` Scheduler ` is required for a few reasons, but the most important is that query notifications can
25+ trigger on the thread of your choice. The query can then be run without blocking the main thread or
26+ the thread which caused the trigger.
27+
2428The ` BriteDatabase.createQuery ` method is similar to ` SQLiteDatabase.rawQuery ` except it takes an
2529additional parameter of table(s) on which to listen for changes. Subscribe to the returned
2630` Observable<Query> ` which will immediately notify with a ` Query ` to run.
@@ -136,7 +140,7 @@ of updates to tables such that you can update queries as soon as data changes.
136140This library is not an ORM. It is not a type-safe query mechanism. It won't serialize the same POJOs
137141you use for Gson. It's not going to perform database migrations for you.
138142
139- A day may come when some of those features are added, but it is not this day .
143+ Some of these features are offered by [ SQLDelight ] [ sqldelight ] which can be used with SQLBrite .
140144
141145
142146
@@ -173,3 +177,4 @@ License
173177
174178
175179 [ snap ] : https://oss.sonatype.org/content/repositories/snapshots/
180+ [ sqldelight ] : https://github.com/square/sqldelight/
0 commit comments