Skip to main content

Module seq_tracking

Module seq_tracking 

Source
Expand description

Sequence ID tracking helpers for subscriptions.

Centralises _seq extraction from row data so that all SDKs (native/Dart via SharedConnection, WASM/TypeScript via client.rs) resume subscriptions from the correct position after reconnect.

The _seq column is a KalamDB system column present in every subscription row. It is a Snowflake-based monotonically increasing identifier that the server uses for change tracking.

Constants§

SEQ_COLUMN
Name of the system sequence column in every subscription row.

Functions§

advance_seq
Update current to candidate if candidate is strictly greater (or current is None).
extract_max_seq
Extract the maximum _seq value from a slice of named-column rows.
retain_rows_after
Remove rows whose _seq is less than or equal to after.
row_seq
Extract a row-level _seq value, if present and parseable.
track_rows
Convenience: extract the max _seq from rows and advance current.