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_txleft 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 valueread_one("#inst \"RFC3339\"")yields, so it round-trips through the reader. (mino has no distinctValue::Instant;#instexpands to this constructor call at read time — seecrates/mino/src/reader.rs.) - kw_ns
- A namespaced keyword
Value, e.g.:mentat.store/conn. - str_val
- A string
Value. - tx_
report_ value - A
TxReportas 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 valueread_one("#uuid \"…\"")yields since the mino refresh (Task 8), so it prints back as#uuid "…"and round-trips. An unparseable string falls back to theparse-uuidreader form so callers still get a value that re-reads to the intended UUID.