Observe Tables as Flow
Get reactive updates when the database changes.
Why Observe Instead of Poll
Re-running a query by hand misses changes. SQLDelight can push fresh results to you whenever the table changes.
Add the Coroutines Extension
Reactive queries need the coroutines-extensions artifact, which adds Flow support on top of your generated queries.
implementation("app.cash.sqldelight:coroutines-extensions:2.0.2")All lessons in this course
- Add SQLDelight & Write .sq Schemas
- Platform SqlDriver Setup
- Insert, Query & Update Rows
- Observe Tables as Flow