Change Feed
koldstore.changes_since is the packaged SQL change API for managed tables. It
merges the hot change-log mirror and cold Parquet into one latest-state
stream ordered by seq.
This is catch-up for clients (and aligns with KalamDB subscribe semantics for
from / newest-N). It is not a full temporal audit log of every historical
event.
Signature
Modes
| Mode | Arguments | Behavior |
|---|---|---|
| Resume | since_seq > 0 | Rows with seq > since_seq, ascending, capped by limit_rows. last_rows is ignored. |
| Rewind | since_seq = 0 and last_rows set | Newest N retained changes, delivered oldest → newest |
| From start | since_seq = 0, no last_rows | Start of retained history |
Precedence rule: a positive since_seq always wins over last_rows.
Examples
Fence first when you need a strong boundary against the heap:
Page from the beginning
Resume after the last consumed seq
Advance your cursor from the highest seq you successfully processed.
Newest N (subscribe-style rewind)
last_rows must be <= limit_rows.
After flush
The same cursor continues to return flushed rows from cold (source = 'cold').
Do not treat “mirror empty” as “caught up” if cold still holds retained history.
Semantics and caveats
- Exclusive cursor:
seq > since_seq, never inclusive. - Authoritative
seqvalues come only from the serialized WAL applier. - Latest-state per PK — updates replace prior images; deletes appear as tombstones until pruned by flush retention rules.
since_seq = 0means “start of retained history,” not “I fell behind retention.”- A positive
since_seqolder than the retained cold floor raises a retention-gap error — do not treat an empty page as success in that case. - Hot + cold merge;
sourcetells you which tier contributed the row image.
Direct mirror SQL (advanced)
You can inspect the hot mirror for debugging:
Prefer changes_since in application code so cold history stays visible after
flush and retention-gap errors stay consistent.