Database¶
transcript_indexer.db.connection
¶
Connection factory: WAL, sqlite-vec, migrations, and meta consistency.
The chunk_embeddings vec0 table is dimension-locked at create time, so it
is created here at runtime from config rather than in the migration. The
chosen dimensions/provider/model are recorded in the meta table; if config
disagrees with meta on a later open, we refuse to start and direct the user
to txi reembed --change-dimension.
open_connection(cfg, *, read_only=False)
¶
Open a SQLite connection with sqlite-vec loaded, WAL mode, FK enforcement, migrations applied, and chunk_embeddings ensured.
Source code in src/transcript_indexer/db/connection.py
open_for_path(db_path, dimensions=1024)
¶
Test-friendly opener: bypass Config, point at an explicit DB path.
Source code in src/transcript_indexer/db/connection.py
transcript_indexer.db.schema
¶
Migration runner. Tracks schema version via PRAGMA user_version.
migrate(conn)
¶
Apply any pending migrations. Returns the new user_version.