Skip to content

Sources

Logged state

The sqlload logged-state command, for Python tables with state="logged": inspect and correct their logged position.

This page is only for Python tables with state="logged": tables that keep a position the data can’t carry, such as an API sync token. Most projects never use it, because tables with a cursor_column find their position in the loaded data.

sqlload logged-state shows and corrects that logged position:

sqlload logged-state show [SELECT ...]
sqlload logged-state verify [SELECT ...]
sqlload logged-state reconcile [SELECT ...] [--yes]
sqlload logged-state reset SELECT ... (--to VALUE | --clear) [--yes]

These commands work on Python tables with state="logged", whose position is kept in an append-only run log. See Cursors and state. With no selector, every logged table is selected; reset needs the tables or sources named.

Command Does
show Prints each logged table’s run log and current state. Read-only.
verify Compares each table’s logged cursor with the data. Read-only; exits 1 when they disagree.
reconcile Appends a reconciliation that adopts the data’s position where the log disagrees.
reset --to VALUE Appends a reset: the next run reads from VALUE. On a table with a cursor_column, VALUE is a cursor value and ctx.state is kept; otherwise it’s the ctx.state value as JSON.
reset --clear Appends a reset that forgets the position, cursor and ctx.state both: the next run reads from the beginning (cursor_start, or everything).

reconcile and reset only show what they would append, unless given --yes. Nothing is ever deleted from the log.

$ sqlload logged-state show
raw.shop__events state 4 (run e9f46950-4e6e-4956-ae4f-1fbeb498b3ff at 2026-11-06T23:02:50.939416Z)
2026-11-06T23:02:50.785656Z 32e4f7ad-9c92-49d4-9e6e-29c8be864d99 run - -> -, state 2 6 rows
2026-11-06T23:02:50.939416Z e9f46950-4e6e-4956-ae4f-1fbeb498b3ff run - -> -, state 4 6 rows
$ sqlload logged-state verify
raw.shop__events ok state 4 (run e9f46950-4e6e-4956-ae4f-1fbeb498b3ff at 2026-11-06T23:02:50.939416Z)
$ sqlload logged-state reset shop__events --to 0
would append raw.shop__events reset - -> -, state 0 (add --yes to append it)

A record SQLLoad can’t read, because it’s corrupt or written by a newer version, blocks only its own table. logged-state show lists it, and a reset ... --yes starts a new position after it.

load --reload also starts a logged table over.