Skip to content

Commit 6b686be

Browse files
committed
Update readme
1 parent 37ddc67 commit 6b686be

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

integrations/room/README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ To also transfer local writes to PowerSync, you need to
5454
1. Create triggers on your Room tables to insert into `ps_crud` (see the
5555
[PowerSync documentation on raw tables](https://docs.powersync.com/usage/use-case-examples/raw-tables#capture-local-writes-with-triggers)
5656
for details).
57-
2. Listen for Room changes and invoke a helper method to transfer them to PowerSync:
58-
```Kotlin
59-
yourRoomDatabase.getCoroutineScope().launch {
60-
// list all your tables here
61-
yourRoomDatabase.invalidationTracker.createFlow("users", "groups", /*...*/).collect {
62-
pool.transferRoomUpdatesToPowerSync()
63-
}
64-
}
65-
```
57+
2. Pass the schema as a second parameter to the `RoomConnectionPool` constructor. This will make the
58+
pool notify PowerSync on Room writes for every raw table mentioned in the schema.
59+
Alternatively, call `transferPendingRoomUpdatesToPowerSync` after writes in Room.

0 commit comments

Comments
 (0)