Expand description
The in-memory SQL store — the internal working representation of the
inventory. Markdown files remain the durable storage; per CLI invocation
the corpus is loaded and decomposed into GlueSQL tables (schema), commands
operate on those tables (plus reconstructed Docs for the Rust-side
invariants: rules, linkify, mdprism), and [Store::flush] writes changed
documents back to disk (create/rename/delete/ledger included).
Internal SQL conventions: values are ALWAYS bound as $n parameters (never
string-interpolated); no IN (subquery), no FROM-subqueries, no UNION
(unsupported), no correlated subqueries — GlueSQL executes those as O(n×m)
nested loops or rejects them. Multi-table aggregates run as separate simple
statements combined in Rust.
Structs§
- Flush
Plan - What a flush must persist, as absolute paths and rendered text — computed without touching the filesystem so any backend can execute it.
- Loaded
Corpus - An already-read, already-parsed corpus snapshot — the input to
Store::build. The storage backend produces this from the durable medium (reading and parsing documents and the retired ledger);buildturns it into the working store with no filesystem access. - Store
- The in-memory corpus database for one CLI invocation.