Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
Prepare for release 0.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Aug 31, 2015
1 parent ac27420 commit f57c3d2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Change Log
=========

Version 0.3.0 *(2015-08-31)*
----------------------------

* Transactions are now exposed as objects instead of methods. Call `newTransaction()` to start a
transaction. On the `Transaction` instance, call `markSuccessful()` to indicate success and
`end()` to commit or rollback the transaction. The `Transaction` instance implements `Closeable`
to allow its use in a try-with-resources construct. See the `newTransaction()` Javadoc for more
information.
* `Query` instances can now be turned directly into an `Observable<T>` by calling `asRows` with a
`Func1<Cursor, T>` that maps rows to a type `T`. This allows easy filtering and limiting in
memory rather than in the query. See the `asRows` Javadoc for more information.
* `createQuery` now returns a `QueryObservable` which offers a `mapToList` operator. This operator
also takes a `Func1<Cursor, T>` for mapping rows to a type `T`, 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 the `mapToList` Javadoc for more information.
* New: Nullability, `@CheckResult`, and `@WorkerThread` annotations on all APIs allow a more useful
interaction with lint in consuming projects.


Version 0.2.1 *(2015-07-14)*
----------------------------

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,19 @@ users.subscribe(new Action1<Query>() {
});
System.out.println("Queries: " + queries.get()); // Prints 1

db.beginTransaction();
Transaction transaction = db.newTransaction();
try {
db.insert("users", createUser("jw", "Jake Wharton"));
db.insert("users", createUser("mattp", "Matt Precious"));
db.insert("users", createUser("strong", "Alec Strong"));
db.setTransactionSuccessful();
transaction.setSuccessful();
} finally {
db.endTransaction();
transaction.end();
}

System.out.println("Queries: " + queries.get()); // Prints 2
```
*Note: You can also use try-with-resources with a `Transaction` instance.*

Since queries are just regular RxJava `Observable` objects, operators can also be used to
control the frequency of notifications to subscribers.
Expand Down Expand Up @@ -143,7 +144,7 @@ Download
--------

```groovy
compile 'com.squareup.sqlbrite:sqlbrite:0.2.1'
compile 'com.squareup.sqlbrite:sqlbrite:0.3.0'
```

Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.squareup.sqlbrite
VERSION_NAME=0.3.0-SNAPSHOT
VERSION_NAME=0.3.0

POM_DESCRIPTION=A lightweight wrapper around SQLiteOpenHelper which introduces reactive stream semantics to SQL operations.

Expand Down

0 comments on commit f57c3d2

Please sign in to comment.