Advanced Realtime Mode
Use advanced mode when you want protocol events instead of a pre-materialized row set.
If your UI only needs current rows, use live() or liveTable() first. They expose onCheckpoint too, so durable resume does not require raw event handling.
liveEvents(sql, onEvent, options?) is the low-level API.
Low-level SQL events
Use this path for protocol tooling, debugging, custom reconciliation, or event processors that need direct access to subscription_ack, initial_data_batch, change, and error frames.
Options
batchSizechunks the initial snapshot from the server.lastRowsincludes the last N rows before live changes begin.fromresumes from a knownSeqIdcheckpoint.autoFetchBatchescontrols whether the client asks for remaining startup batches automatically.onCheckpointfires whenever the SDK observes a newer applied sequence ID.onErrorreceives protocol error frames without forcing your event callback to branch on every error.
Checkpoints
The checkpoint is a single SeqId. Snapshot and commit boundaries stay server-owned.
Event model
Use runtime enums from @kalamdb/client:
Common sequence:
subscription_ack- one or more
initial_data_batch changeevents withinsert,update, ordelete- optional
error
SQL safety for dynamic filters
liveEvents() accepts a SQL string. For dynamic values:
- Prefer validated numeric IDs before interpolation.
- Do not interpolate raw user text directly into SQL.
Related docs
Last updated on