Datom representation, the bootstrap schema, index construction, and the read interfaces over immutable db values. Entity-id packing lives in kala.eid — a pure-arithmetic leaf this namespace places bootstrap schema entities through; the allocation counter is db-value state kala.tx advances. The transaction pipeline lives in kala.tx; time travel and log replay in kala.time-travel. No I/O here: storage sits behind the Storage protocol (seam 2). Reads go through immutable db values — plain maps keyed :kala.core/*, which every kala module shares.
Datom representation, the bootstrap schema, index construction, and the read interfaces over immutable db values. Entity-id packing lives in kala.eid — a pure-arithmetic leaf this namespace places bootstrap schema entities through; the allocation counter is db-value state kala.tx advances. The transaction pipeline lives in kala.tx; time travel and log replay in kala.time-travel. No I/O here: storage sits behind the Storage protocol (seam 2). Reads go through immutable db values — plain maps keyed :kala.core/*, which every kala module shares.
(attr-datoms-vec db a-id)(attr-eid ident)The deterministic entity id of a bootstrap schema attribute. Public for kala.tx, which stamps :db/txInstant on every transaction entity.
The deterministic entity id of a bootstrap schema attribute. Public for kala.tx, which stamps :db/txInstant on every transaction entity.
(attr-map {:db/keys [ident valueType cardinality unique isComponent]} id)The registry attribute-map for a schema spec — the one constructor of the ::schema-by-ident shape, cardinality default included. Public for kala.tx, which re-derives the same spec from an entity's datoms at registration; the bootstrap schema builds it from its literal specs.
The registry attribute-map for a schema spec — the one constructor of the ::schema-by-ident shape, cardinality default included. Public for kala.tx, which re-derives the same spec from an entity's datoms at registration; the bootstrap schema builds it from its literal specs.
(attribute db ident)The transaction counter of the genesis transaction.
The transaction counter of the genesis transaction.
(datoms db index components)(db-storage db)The storage handle backing a db value. The plain-map read accessor for the ::storage key — read db-value state through this, not the raw key.
The storage handle backing a db value. The plain-map read accessor for the ::storage key — read db-value state through this, not the raw key.
(db-t db)The db value's transaction counter t. The plain-map read accessor for the ::t key — read db-value state through this, not the raw key.
The db value's transaction counter t. The plain-map read accessor for the ::t key — read db-value state through this, not the raw key.
(empty-db storage)(entid db ident-or-eid)(entity-datoms db a-id e)All datoms of attribute a-id for entity e.
All datoms of attribute a-id for entity e.
(err kind msg data)Raise the error shape every kala module shares: an ex-info whose data carries :kala/error. The error contract is part of the public interface.
Raise the error shape every kala module shares: an ex-info whose data carries :kala/error. The error contract is part of the public interface.
(index-slice db index comps)(lookup-attr db ident-or-id)An attribute's schema map by ident or by attr id, or nil. Public for kala.tx's op resolution and map-form expansion.
An attribute's schema map by ident or by attr id, or nil. Public for kala.tx's op resolution and map-form expansion.
(many-attr? attr)(materialize db e)(materialize db e value-fn)An entity's datoms as a plain map keyed by attribute ident (the raw attr id when no schema entry exists), :db/id kept as the argument's original reference. Cardinality-many attributes collect into vectors. A keyword eid that resolves to nothing materializes as nil — an entity that does not exist reads as absent, not as an error. The optional value-fn transforms each (attr value) before it lands — kala.entity's touch expands components through it. Public for kala.entity and kala.pull, whose touch and wildcard reads are this one shape.
An entity's datoms as a plain map keyed by attribute ident (the raw attr id when no schema entry exists), :db/id kept as the argument's original reference. Cardinality-many attributes collect into vectors. A keyword eid that resolves to nothing materializes as nil — an entity that does not exist reads as absent, not as an error. The optional value-fn transforms each (attr value) before it lands — kala.entity's touch expands components through it. Public for kala.entity and kala.pull, whose touch and wildcard reads are this one shape.
(public-datom db d)The public shape of a datom: attribute resolved to its ident. Public for kala.tx, which reports :tx-data in the same shape readers see.
The public shape of a datom: attribute resolved to its ident. Public for kala.tx, which reports :tx-data in the same shape readers see.
(ref-datom? db d)Is this datom's attribute a :db.type/ref? Drives VAET membership. Public for kala.tx's index maintenance.
Is this datom's attribute a :db.type/ref? Drives VAET membership. Public for kala.tx's index maintenance.
(referrers db attr e)Entity ids that reference e through attr — the VAET read keyed by ref-entid. Public for kala.entity and kala.pull, whose reverse reads are this one shape.
Entity ids that reference e through attr — the VAET read keyed by ref-entid. Public for kala.entity and kala.pull, whose reverse reads are this one shape.
(resolve-entid db x)The :e-slot rule resolve-components applies: a keyword resolves through entid (nil when unresolvable), everything else is already an entity id. Public for kala.entity and kala.pull, whose entry points accept the same reference forms.
The :e-slot rule resolve-components applies: a keyword resolves through entid (nil when unresolvable), everything else is already an entity id. Public for kala.entity and kala.pull, whose entry points accept the same reference forms.
(reverse-attr a)(reverse-attr? a)(seek-datoms db index components)(slice index-set index comps)The contiguous run of one index matching a prefix of components, eager. Public for kala.tx (current-datom lookups, entity retraction) and the entity/pull readers — the same primitive as every other slice.
The contiguous run of one index matching a prefix of components, eager. Public for kala.tx (current-datom lookups, entity retraction) and the entity/pull readers — the same primitive as every other slice.
(value-datoms db a-id v)All datoms of attribute a-id whose value is v. Hash lookup; byte-array values fall back to a content-equality scan because arrays cannot be hash keys (their equality is content equality, their hash is identity).
All datoms of attribute a-id whose value is v. Hash lookup; byte-array values fall back to a content-equality scan because arrays cannot be hash keys (their equality is content equality, their hash is identity).
(value-eq x y)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 |