Expand description
Backend-independent mino mentat.store/* scripting glue (plan § 1.19).
Both Mentat backends — the embedded SQLite [Store] and the pg_mentat
engine — expose the same Datomic-a-like mentat.store/* language surface
(14 prims). This crate holds everything that surface needs that does not
depend on the storage engine:
- the db-value map shape and its destructuring (
values::DbRef,values::db_value,values::destructure_db); - the tx-report projection and the tagged inst/uuid/keyword value builders
(
values); - argument parsing (conn handle, eid, keyword, tx id);
install, which registers all 14mentat.store/*prims onto a mino interpreter, driving each through aScriptBackend.
A backend implements ScriptBackend (storage + its own result
conversion: Binding→Value for Mentat, JSON→Value for pg_mentat) and
calls install. The Datomic-model test suite (tests/model.rs) runs
against a fake in-memory backend here, and against both real backends in
their own crates — one suite, proven three ways.
Re-exports§
pub use prims::install;pub use values::db_value;pub use values::destructure_db;pub use values::inst_value;pub use values::kw_ns;pub use values::str_val;pub use values::tx_report_value;pub use values::DbRef;pub use values::TxReport;
Modules§
- model_
tests - The Datomic-model test suite for the
mentat.store/*scripting surface, written once and run against every [ScriptBackend] (plan § 1.19). - prims
install: register all 14mentat.store/*prims onto a mino interpreter, each driving through a sharedScriptBackend. Argument parsing, the db-value shape, and result wrapping live here; storage and result conversion live in the backend.- values
- Backend-independent mino
Valuebuilders and theDbRefshape shared by both Mentat scripting backends (SQLiteStoreand pg_mentat’s engine).
Traits§
- Script
Backend - The storage seam between the shared
mentat.store/*surface and a concrete engine. A backend owns storage and its own result conversion (each read method returns an already-built minoValue); the sharedinstallowns argument parsing, the db-value shape, and result wrapping.