Liking cljdoc? Tell your friends :D

kala.core

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.
raw docstring

attr-datoms-vecclj

(attr-datoms-vec db a-id)

attr-eidclj

(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.
raw docstring

attr-mapclj

(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.
raw docstring

attributeclj

(attribute db ident)

bootstrap-tclj

The transaction counter of the genesis transaction.

The transaction counter of the genesis transaction.
raw docstring

datomsclj

(datoms db index components)

db-storageclj

(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.
raw docstring

db-tclj

(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.
raw docstring

empty-dbclj

(empty-db storage)

entidclj

(entid db ident-or-eid)

entity-datomsclj

(entity-datoms db a-id e)

All datoms of attribute a-id for entity e.

All datoms of attribute a-id for entity e.
raw docstring

errclj

(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.
raw docstring

index-sliceclj

(index-slice db index comps)

index-specsclj


lookup-attrclj

(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.
raw docstring

many-attr?clj

(many-attr? attr)

materializeclj

(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.
raw docstring

public-datomclj

(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.
raw docstring

ref-datom?clj

(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.
raw docstring

referrersclj

(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.
raw docstring

resolve-entidclj

(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.
raw docstring

reverse-attrclj

(reverse-attr a)

reverse-attr?clj

(reverse-attr? a)

seek-datomsclj

(seek-datoms db index components)

sliceclj

(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.
raw docstring

value-datomsclj

(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).
raw docstring

value-eqclj

(value-eq x y)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close