Skip to main content

resolve_store_path

Function resolve_store_path 

Source
pub fn resolve_store_path(api_version: &str) -> Result<PathBuf>
Expand description

Resolves the active api_version (from the config cascade) to its store file. Every .db this crate supports is embedded into the compiled binary via include_bytes! (VERSION_STORE_BYTES) exactly like validator.rs embeds each version’s schema — there is no filesystem fallback chain to reason about, and this crate never depends on any particular .db file existing anywhere on disk after cargo install. The one difference from a schema lookup: SQLite needs a real file to open a Connection against (unlike a &[u8] JSON schema, read directly from memory), so this extracts the embedded bytes to a fixed path in the OS temp dir on every call — cheap, since it only runs once per process start, and it means a rebuilt binary with different embedded bytes (a populate_embeddings re-run, an add-version update) can never be shadowed by a stale leftover from a previous install at that same path.