Skip to content

Commit

Permalink
Merge branches 'develop' and 'master' of https://github.com/agrosner/…
Browse files Browse the repository at this point in the history
…DBFlow into develop

� Conflicts:
�	usage2/README.md
�	usage2/rxjavasupport.md
�	usage2/usage/models.md
  • Loading branch information
agrosner committed Mar 13, 2021
2 parents 9ff4dac + e5aea43 commit 9a57e27
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 60 deletions.
45 changes: 0 additions & 45 deletions .github/contributing.md

This file was deleted.

2 changes: 0 additions & 2 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@
* [5.0 Migration Guide](usage2/5.0-migration-guide.md)
* [Migration4Guide](usage2/migration4guide.md)
* [ISSUE\_TEMPLATE](issue_template.md)
* [.github](.github/README.md)
* [CONTRIBUTING](.github/contributing.md)

7 changes: 6 additions & 1 deletion usage2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ abstract class AppDatabase: DBFlowDatabase
The `@Database` annotation generates a `DatabaseDefinition` which now references your SQLite Database on disk in the file named "AppDatabase.db". You can reference it in code as:

```java
val db: DatabaseDefinition = database<AppDatabase>();
val db = database<AppDatabase>();

// or
database<AppDatabase> { db ->

}
```

To ensure generated code in DBFlow is found by the library, initialize the library in your `Application` class:
Expand Down
24 changes: 12 additions & 12 deletions usage2/rxjavasupport.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

RXJava support in DBFlow is an _incubating_ feature and likely to change over time. We support RXJava3 only and have made the extensions + DBFlow compatibility almost identical - save for the changes and where it makes sense in each version.

Currently it supports
Currently it supports

1. Any `ModelQueriable` can be wrapped in a `Single`, `Maybe`, or `Flowable` \(to continuously observe changes\).
1. Any `ModelQueriable` can be wrapped in a `Single`, `Maybe`, or `Flowable` \(to continuously observe changes\).

2. Single + `List` model `save()`, `insert()`, `update()`, and `delete()`.
2. Single + `List` model `save()`, `insert()`, `update()`, and `delete()`.

3. Streaming a set of results from a query
3. Streaming a set of results from a query

4. Observing on table changes for specific `ModelQueriable` and providing ability to query from that set repeatedly as needed.

Expand All @@ -34,7 +34,7 @@ For a single query:
Using vanilla transactions:

```kotlin
(select
(select
from MyTable::class)
.async(db) { d -> queryList(d) }
.execute { _, r ->}
Expand All @@ -43,11 +43,11 @@ Using vanilla transactions:
Using RX:

```kotlin
(select
(select
from MyTable::class)
.async(db) { d -> queryList(d) }
.asSingle()
.subscribeBy { list ->
.subscribeBy { list ->
// use list
}
```
Expand All @@ -57,10 +57,10 @@ Using RX:
We can easily observe a query for any table changes \(once per transaction\) while it is active and recompute via:

```kotlin
(select
(select
from MyTable::class)
.asFlowable { db -> queryList(db) }
.subscribeBy { list ->
.subscribeBy { list ->
// use list
}
```
Expand All @@ -74,8 +74,8 @@ Operations are as easy as:
```kotlin
Person(5, "Andrew Grosner")
.rxInsert(db) // rxSave, rxUpdate, etc.
.subscribeBy { rowId ->
.subscribeBy { rowId ->

}
```

Expand All @@ -86,7 +86,7 @@ We can use RX to stream the result set, one at a time from the `ModelQueriable`
```kotlin
(select from TestModel::class)
.queryStreamResults(db)
.subscribeBy { model ->
.subscribeBy { model ->

}
```
Expand Down

0 comments on commit 9a57e27

Please sign in to comment.