(add-map-datoms datoms id m prev-m db-snap)
(add-map-indexes db-snap id m prev-m)
(contains? db-snap id)
Returns true if entity with given id exists in db.
Returns true if entity with given id exists in db.
(create)
(create schema)
Create a new db, with optional schema, which should be a mapping of attribute keys to the following options:
:db/index [true, :db.index/unique] :db/cardinality [:db.cardinality/many]
Create a new db, with optional schema, which should be a mapping of attribute keys to the following options: :db/index [true, :db.index/unique] :db/cardinality [:db.cardinality/many]
(db-log & body)
(entities db-snap qs)
(entity db-snap id)
Returns entity for resolved id.
Returns entity for resolved id.
(entity-ids db-snap qs)
(get db-snap id attr)
(get db-snap id attr not-found)
Get attribute in entity with given id.
Get attribute in entity with given id.
(get-in db-snap id ks)
(get-in db-snap id ks not-found)
Get-in the entity with given id.
Get-in the entity with given id.
(get-in* m ks)
(get-in* m ks not-found)
Compiled version of get-in, small performance boost over the get-in
function.
Compiled version of get-in, small performance boost over the `get-in` function.
(get-schema db-snap a)
(index? schema)
(index? db-snap a)
Returns true if attribute is indexed.
Returns true if attribute is indexed.
(listen db f)
(listen db patterns f)
Adds listener for transactions which contain datom(s) matching the provided pattern. If patterns not provided, matches all transactions.
Patterns should be a map containing any of the following keys, each containing a collection of patterns:
:e__ entity [id _ _] :ea_ entity-attribute [id attr _] :_av attribute-value [_ attr val] :a attribute [_ attr _]
Adds listener for transactions which contain datom(s) matching the provided pattern. If patterns not provided, matches all transactions. Patterns should be a map containing any of the following keys, each containing a collection of patterns: :e__ entity [id _ _] :ea_ entity-attribute [id attr _] :_av attribute-value [_ attr val] :_a_ attribute [_ attr _]
(many? schema)
(many? db-snap a)
Returns true for attributes with cardinality many
, which store a set of values for each attribute.
Returns true for attributes with cardinality `many`, which store a set of values for each attribute.
(merge-schema! db schema)
Merge additional schema options into a db. Indexes are not created for existing data.
Merge additional schema options into a db. Indexes are not created for existing data.
(peek & body)
Evaluates body without tracking read patterns.
Evaluates body without tracking read patterns.
(ref? schema)
(resolve-id db-snap id)
(resolve-id db-snap attr val)
Returns id, resolving lookup refs (vectors of the form [attribute value]
) to ids.
Lookup refs are only supported for indexed attributes.
The 3-arity version is for known lookup refs, and does not check for uniqueness.
Returns id, resolving lookup refs (vectors of the form `[attribute value]`) to ids. Lookup refs are only supported for indexed attributes. The 3-arity version is for known lookup refs, and does not check for uniqueness.
(select-keys db-snap id ks)
Select keys from entity of id
Select keys from entity of id
(touch db-snap {:keys [db/id] :as entity})
Add refs to entity
Add refs to entity
(transact! db txs)
(transact! db txs {:keys [notify log-datoms] :or {notify true}})
(unique? schema)
(unique? db-snap a)
Returns true for attributes where :db/index is :db.index/unique.
Returns true for attributes where :db/index is :db.index/unique.
(unlisten db f)
(unlisten db patterns f)
Remove listener from patterns (if provided) or :tx-log.
Remove listener from patterns (if provided) or :tx-log.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close