Skip to main content

Module values

Module values 

Source
Expand description

Backend-independent mino Value builders and the DbRef shape shared by both Mentat scripting backends (SQLite Store and pg_mentat’s engine).

Everything here is pure value construction/destructuring — no storage. The db-value map shape, the tx-report projection, and the tagged inst/uuid builders live here so the two backends stop drifting (§ 1.19).

Structs§

DbRef
A destructured db value: which conn, its basis tx, and any temporal bound.
TxReport
A backend-independent transaction report: the tx id and tempid resolutions.

Functions§

db_value
Build a db-value mino map: {:mentat.store/db true :mentat.store/conn N :mentat.store/basis-tx T :mentat.store/as-of A :mentat.store/since S}.
destructure_db
Destructure a db value, accepting a bare conn Int (treated as the current db: basis_tx left 0, as-of/since nil — backends re-read the live basis when they need it). A db map carries its conn, basis, and temporal bound.
inst_value
The instant reader form (clojure.instant/read-instant-date "RFC3339") — the exact value read_one("#inst \"RFC3339\"") yields, so it round-trips through the reader. (mino has no distinct Value::Instant; #inst expands to this constructor call at read time — see crates/mino/src/reader.rs.)
kw_ns
A namespaced keyword Value, e.g. :mentat.store/conn.
str_val
A string Value.
tx_report_value
A TxReport as a mino map {:mentat.store/tx-id N :mentat.store/tempids {...}}, optionally carrying a :mentat.store/db-after.
uuid_value
A real UUID Value — the same value read_one("#uuid \"…\"") yields since the mino refresh (Task 8), so it prints back as #uuid "…" and round-trips. An unparseable string falls back to the parse-uuid reader form so callers still get a value that re-reads to the intended UUID.