Module storage
Expand description
Connection-only write-plane storage, schema upgrades, and DDL safety guards.
Structs§
- Producer
Census - How many distinct producers hold durable watermark state — the growth signal design 306 §4 names as the mitigation for the one contract it cannot enforce server-side.
Constants§
- PRODUCER_
OFFSETS_ TABLE - The foreign-write dedup watermark (design 306): one row per producer, overwritten in place.
Functions§
- ddl_
only_ violation_ message - Enrich the DDL-only guard’s rejection when a
DROP TABLEcaused SQLite’s implicit foreign-key delete. - ensure_
data_ migrations_ table - Create the captured apply-once data-migration journal.
- ensure_
log_ meta_ table - Create the host-local outcome-floor table.
- ensure_
master_ migrations_ table - Create the producer/master shape of the DDL migration journal. A daemon with its existing
surrogate-key shape calls
ensure_migration_identity_columnsinstead. - ensure_
master_ run_ id_ indexes - Index the two
run_idcolumns the master’s post-commit path seeks on — master only, and deliberately not part ofensure_sql_outcomes_table. - ensure_
migration_ identity_ columns - Add the common identity columns to either supported
_rindle_migrationstable shape. - ensure_
producer_ offsets_ table - Create the foreign-write producer watermark table.
- ensure_
sql_ outcome_ identity_ column - Add exact-request and resolved-cursor columns to a legacy outcome cache.
- ensure_
sql_ outcomes_ table - Create the exact public SQL outcome cache in its current shape.
- ensure_
writeplane_ tables - Create every storage table owned by the producer/master write plane.
- pre_
ddl_ table_ names - Snapshot the non-internal table names before a DDL run.
- producer_
offsets_ ddl - The
CREATE TABLEfor the foreign-write producer watermark. Shared verbatim by every host that mints it — the connection-only bootstrap here, rindled’s cluster DDL, the write-master’s open batch, and the restore’s runtime initialization — so the four cannot drift into two shapes. - producer_
offsets_ upsert_ sql - The producer watermark’s upsert, shared with the capture-aware writers that must run it through
their own
exec(the row is replicated data, not connection-local bookkeeping) rather than throughupsert_producer_seq. - read_
lmid - Read the durable last mutation id for
client_id, or zero when absent. - read_
producer_ seq - Read the durable last sequence a producer wrote, or zero when the producer is new.
- refuse_
broken_ foreign_ keys - Refuse a DDL run that leaves a dangling foreign key or recreates a referenced table without its referenced key.
- statement_
is_ drop_ table - Whether
sqlis a comment-tolerantDROP TABLEstatement. - upsert_
lmid - Upsert the durable last mutation id inside the caller’s open transaction.
- upsert_
producer_ seq - Upsert the producer watermark inside the caller’s open transaction. MUST run in the same transaction as the effects it deduplicates, so a crash can never commit an effect without its receipt (design 306 §3.2).
- validate_
public_ ddl_ poststate - Validate the producer-side post-state shared by standalone deploy migrations and public SQL DDL. Call this from the schema transaction’s final validation hook, before any outcome/journal tail and before COMMIT, so every refusal rolls the schema and its host bookkeeping back as one unit.