Module migrate

Module migrate 

Source
Expand description

One-shot SQLite → file-registry migration. Runs at most once per <root>/.migrated_from_sqlite marker; idempotent and read-only on every SQLite it touches. See SPEC §8.

Structs§

MigrateStats
Outcome stats — surfaced in the marker file + the srv log.
RowSnapshot 🔒

Constants§

MARKER 🔒
Marker filename. Lives in the registry root so the registry’s existence implies the migration question has been asked at least once.

Functions§

empty_to_none 🔒
is_missing_column_or_table 🔒
True iff the error is SQLite reporting “this column/table doesn’t exist in this DB’s schema.” Distinguishes a pre-v8 DB (skip silently — those agents weren’t named, so wouldn’t appear in the dropdown anyway) from corruption (caller logs + continues + defers the marker).
migrate_from_sqlite_once
Scan every per-version data/db/objects.db and populate the shared registry. Skipped if the marker file exists. Never overwrites an existing registry record (idempotency + respect for newer-written data). The SQLite files are opened read-only — never modified.
read_named_rows 🔒
row_to_record 🔒
write_marker 🔒