Skip to main content

Crate inillucent_sqlite_reader

Crate inillucent_sqlite_reader 

Source
Expand description

A read-only reader for SQLite 3 database files.

Invariant: this crate opens a file and never writes to it. DatabaseOptions is set read-only, no journal is attached, and there is no code path here that calls a mutating pager method. A migration that damaged its source would be worse than one that failed.

§Why it exists after file-format compatibility stopped being a goal

The rearchitecture plan drops SQLite file-format compatibility as a requirement, but two things still need to read a SQLite file:

  • The correctness gate. The differential harness compares inillucent against SQLite 3.53.4 executing the same SQL on the same logical data. With the shared file gone, the inillucent side gets its data by importing the SQLite fixture through this reader. Same rows, different bytes.
  • Migration. Every database the previous tickets produced is in SQLite format, and inillucent-migrate has to be able to read one.

It is the read half of inillucent-storage with a narrow interface in front of it, which is exactly what the TDD’s component triage says survives that crate’s deletion. This crate reuses inillucent-storage’s pager and b-tree cursor rather than duplicating them, so there is one page decoder in the workspace rather than two that can disagree.

This crate is not the only thing holding inillucent-storage up, and saying so here was wrong. inillucent-catalog reaches for the same pager and the same cursor in load.rs, ddl.rs, analyze.rs and rebuild.rs, on the shipping read path rather than on an import path. Deleting inillucent-storage therefore means re-pointing inillucent-catalog too, which is task-1816 Phase 5’s job and not this crate’s. Anybody reading this header to find out what stands between the workspace and that deletion needs both names.

§What it does not do

No SQL, no planner, no write path, no journal recovery beyond what opening a clean file needs, and no attempt to be fast: an import runs once per fixture and its cost is not on any measured path.

Structs§

SchemaObject
One row of sqlite_schema.
SqliteFile
An open SQLite file, held for reading.

Functions§

borrow
Borrows an owned row, for handing to the tree builder.