The transaction pipeline: op validation and resolution, tempid/upsert
machinery, entity-map expansion, transaction-function invocation, schema
re-derivation (schema is data), and the transact/with entry points. No
I/O beyond the Storage protocol's append-log at the very end of
transact.
Db values keep their shape from kala.core — plain maps keyed :kala.core/*, referenced here through the ::core/ alias. Index maintenance goes through core's index-specs table and slice primitive; nothing index-shaped is re-implemented here.
The transaction pipeline: op validation and resolution, tempid/upsert machinery, entity-map expansion, transaction-function invocation, schema re-derivation (schema is data), and the transact/with entry points. No I/O beyond the Storage protocol's append-log at the very end of `transact`. Db values keep their shape from kala.core — plain maps keyed :kala.core/*, referenced here through the ::core/ alias. Index maintenance goes through core's index-specs table and slice primitive; nothing index-shaped is re-implemented here.
(derive-schema db datoms)Re-derive the schema registry from a tx's net datoms: register what they justify, then prune what they no longer carry (ADR-0003). Public for kala.time-travel: the live pipeline and replay call this alike, so the register-then-prune ordering is the registry's contract, stated here once. Its caller must have finished the datom pass: retract-entity resolves ref/component attributes through the registry mid-pass, so the prune must not run until every op has applied.
Re-derive the schema registry from a tx's net datoms: register what they justify, then prune what they no longer carry (ADR-0003). Public for kala.time-travel: the live pipeline and replay call this alike, so the register-then-prune ordering is the registry's contract, stated here once. Its caller must have finished the datom pass: retract-entity resolves ref/component attributes through the registry mid-pass, so the prune must not run until every op has applied.
(retract-from-indexes db d)(transact conn tx-data)Apply transaction data against the connection (list-form ops, map-form entity maps, any mix) and return the tx report with :db-before, :db-after, :tx-data, and :tempids. Appends to the storage log and swaps the connection atom.
Apply transaction data against the connection (list-form ops, map-form entity maps, any mix) and return the tx report with :db-before, :db-after, :tx-data, and :tempids. Appends to the storage log and swaps the connection atom.
(transact-report db-before tx-data)Pure transaction: applies tx-data against a db value and returns the report {:db-before :db-after :t :tx-data :tempids :raw-datoms} WITHOUT touching storage. This is the speculative path (with) and the core of the write path; the transactor (TT9) owns serialization across processes. :raw-datoms carries internal (attr-id) datoms for the storage log.
Pure transaction: applies tx-data against a db value and returns the
report {:db-before :db-after :t :tx-data :tempids :raw-datoms} WITHOUT
touching storage. This is the speculative path (with) and the core of
the write path; the transactor (TT9) owns serialization across processes.
:raw-datoms carries internal (attr-id) datoms for the storage log.(update-indexes db f d)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |