KalamDB Live Queries
Keep a screen up to date with an initial set of rows followed by inserts, updates, and deletes. Start with an authenticated client and a table created in Choosing Table Types.
Subscribe to KalamDB rows
For a table named app.todos, the TypeScript client can maintain the current rows for you:
client is your authenticated KalamDB client. Change a row from a second connection using the same identity and the callback receives the updated result. A USER table subscription stays within the authenticated user’s data.
Use SQL when you only want part of the table:
The high-level SDK reconciles changes into rows. Use liveEvents() only when you need to process protocol events yourself.
Choose your application integration
| Application | Guide |
|---|---|
| TypeScript or Node.js | Live subscriptions |
| React | useLiveQuery and component lifecycle |
| Rust | Rust live subscriptions |
| Dart or Flutter | Dart live subscriptions |
| Flutter with a persistent local cache | Kalam Sync |
Query limits and cleanup
Live SQL supports a single table and supported WHERE predicates. Do not put joins, aggregates, ORDER BY, or LIMIT in the live SQL. Sort the resulting rows in your UI and use the SDK’s materialization options when you need a bounded view.
Stop a subscription when its view closes or the user changes accounts:
Low-level result fields are typed cells, so convert them with accessors such as asString() and asBool() before rendering. Generated table clients can provide a typed application model.
Next step
Handle reconnection and resume →
Reference: Subscription SQL and supported query shapes.