Skip to main content

Crate fathomdb_schema

Crate fathomdb_schema 

Source
Expand description

FathomDB schema — the versioned migration registry and bootstrap.

An internal leaf crate of the FathomDB workspace. It owns SCHEMA_VERSION, the ordered MIGRATIONS table, and the routine that brings an on-disk SQLite database up to the current version. fathomdb-engine calls it on the open path; application code should depend on the fathomdb facade crate instead and never invoke migration directly.

The on-disk sentinel is SQLite’s PRAGMA user_version. A migration step is applied inside one BEGIN IMMEDIATE together with the version bump, so a crash mid-step rolls back and the step re-runs whole.

⚠ Most steps are accretive, but not all are. Step 23 (TC-33) recreates canonical_edges with INTEGER epoch-second temporal columns and does not migrate the data: existing edge rows do not survive and no stored ISO-8601 value is converted. Nodes are unaffected. Anything that describes upgrading an existing workspace must disclose this.

Structs§

Migration
MigrationAccretionError
MigrationFailureReport
MigrationLogicalIdPinError
0.8.20 Slice 25 (R-20-SUR) — rejection from the TC-11 logical_id pin.
MigrationReport
MigrationStepReport

Enums§

MigrationError

Constants§

CANONICAL_TABLES
Canonical tables owned by the rewrite-era schema, in stable display order. Excludes FTS, vec0, and projection shadow tables (re-derivable from canonical state) and internal _fathomdb_* metadata.
JOURNAL_SUFFIX
Suffix of the optional SQLite rollback journal file (<db-name>.sqlite-journal).
LOCK_SUFFIX
Suffix of the sidecar lock file (<db-name>.sqlite.lock).
MIGRATIONS
PRAGMA_USER_VERSION
SQLite PRAGMA name carrying the on-disk schema-version sentinel.
RESERVED_WRITE_CURSOR_KEY
_fathomdb_open_state key under which step 23 reserved the pre-TC-33 canonical_edges write-cursor high-water mark.
SCHEMA_VERSION
SQLITE_SUFFIX
Suffix of the canonical SQLite database file (<db-name>.sqlite).
WAL_SUFFIX
Suffix of the SQLite write-ahead log file (<db-name>.sqlite-wal).

Functions§

bootstrap_steps
check_migration_accretion
check_migration_logical_id_pin
0.8.20 Slice 25 (R-20-SUR) — the TC-11 pin’s static migration guard, and the sibling of check_migration_accretion.
migrate
migrate_with_event_sink
migrate_with_steps