Skip to main content

Module db

Module db 

Source
Expand description

SQLite schema, bootstrap, and forward migrations.

Mirrors python/src/remote_executor/server/db.py. The schema text is identical so a Python-managed database is readable by the Rust server and vice versa — supporting the rolling Python ↔ Rust migration the plan calls for.

Constants§

SCHEMA_VERSION

Functions§

bootstrap
Apply the schema (CREATE TABLE/INDEX IF NOT EXISTS) and run forward migrations from older versions. Idempotent on a v3 database.
connect
Open a SQLite connection at path, set WAL + foreign-keys + relaxed fsync (matching the Python connect()), and return it. Schema is NOT applied — call bootstrap afterwards.
connect_in_memory
Open an in-memory SQLite for tests.
schema_version
Read the schema_version row (returns 0 if unset).