Releases: square/sqlbrite
0.6.2
0.6.1
- Fix: Apply backpressure strategy between database/content provider and the supplied
Scheduler
.
This guards against backpressure exceptions when the scheduler is unable to keep up with the rate
at which queries are being triggered. - Fix: Indent the subsequent lines of a multi-line queries when logging.
0.6.0
-
New: Require a
Scheduler
when wrapping a database or content provider which will be used when sending query triggers. This allows the query to be run in subsequent operators without needing an additionalobserveOn
. It also eliminates the need to usesubscribeOn
since the suppliedScheduler
will be used for all emissions (similar to RxJava'stimer
,interval
, etc.).This also corrects a potential violation of the RxJava contract and potential source of bugs in that all triggers now occur on the supplied
Scheduler
. Previously the initial value would trigger synchronously (on the subscribing thread) while subsequent ones trigger on the thread which performed the transaction. The new behavior puts the initial trigger on the same thread as all subsequent triggers and also does not force transactions to block while sending triggers.
0.5.1
- New: Query logs now contain timing information on how long they took to execute. This only covers
the time until aCursor
was made available, not object mapping or delivering to subscribers. - Fix: Switch query logging to happen when
Query.run
is called, not when a query is triggered. - Fix: Check for subscribing inside a transaction using a more accurate primitive.
0.5.0
- New: Expose
mapToOne
,mapToOneOrDefault
, andmapToList
as static methods onQuery
. These
mirror the behavior of the methods of the same name onQueryObservable
but can be used later in
a stream by passing the returnedOperator
instances tolift()
(e.g.,
take(1).lift(Query.mapToOne(..))
). - Requires RxJava 1.1.0 or newer.
0.4.1
- New:
execute
method provides the ability to execute arbitrary SQL statements. - New:
executeAndTrigger
method provides the ability to execute arbitrary SQL statements and
notifying any queries to update on the specified table. - Fix:
Query.asRows
no longer callsonCompleted
when the downstream subscriber has unsubscribed.
0.4.0
- New:
mapToOneOrDefault
replacesmapToOneOrNull
for more flexibility. - Fix: Notifications of table updates as the result of a transaction now occur after the transaction
has been applied. Previous the notification would happen during the commit at which time it was
invalid to create a new transaction in a subscriber.
Download:
compile 'com.squareup.sqlbrite:sqlbrite:0.4.0'
0.3.1
- New:
mapToOne
andmapToOneOrNull
operators onQueryObservable
. These work on queries which
return 0 or 1 rows and are a convenience for turning them into a typeT
given a mapper of type
Func1<Cursor, T>
(the same which can be used formapToList
). - Fix: Remove
@WorkerThread
annotations for now. Various combinations of lint, RxJava, and
retrolambda can cause false-positives.
Download:
compile 'com.squareup.sqlbrite:sqlbrite:0.3.1'
0.3.0
- Transactions are now exposed as objects instead of methods. Call
newTransaction()
to start a
transaction. On theTransaction
instance, callmarkSuccessful()
to indicate success and
end()
to commit or rollback the transaction. TheTransaction
instance implementsCloseable
to allow its use in a try-with-resources construct. See thenewTransaction()
Javadoc for more
information. Query
instances can now be turned directly into anObservable<T>
by callingasRows
with a
Func1<Cursor, T>
that maps rows to a typeT
. This allows easy filtering and limiting in
memory rather than in the query. See theasRows
Javadoc for more information.createQuery
now returns aQueryObservable
which offers amapToList
operator. This operator
also takes aFunc1<Cursor, T>
for mapping rows to a typeT
, but instead of individual rows it
collects all the rows into a list. For large query results or frequently updated tables this can
create a lot of objects. See themapToList
Javadoc for more information.- New: Nullability,
@CheckResult
, and@WorkerThread
annotations on all APIs allow a more useful
interaction with lint in consuming projects.
Download:
compile 'com.squareup.sqlbrite:sqlbrite:0.3.0'