Skip to main content

Module store

Module store 

Source
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§

FlushPlan
What a flush must persist, as absolute paths and rendered text — computed without touching the filesystem so any backend can execute it.
LoadedCorpus
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); build turns it into the working store with no filesystem access.
Store
The in-memory corpus database for one CLI invocation.