(-last-tx db)
(-last-tx-match-datom? db datom)
(-last-tx-match-query? db query)
(-last-tx-match-where? db datoms)
(-match-two-datoms d1 d2)
(-submit-commit db tx)
apply transactions to db.
apply transactions to db.
(-tx->datom tx)
(-tx-match-datom? tx datom)
(build-args-map {:keys [in args] :as q})
(build-meander-query m)
(commit db txs)
(commit db txs tx-meta)
apply transactions to db. txs can be either a single transaction or a vector of transactions. returns a modified db. transaction report is stored in the db metadata.
usage: [:dx/put|delete|conj|update|match [table eid] ?m | (?k ?v)]
put: entire map|s with entity id [:dx/put {:person/id :ivan :name "ivan" :age 30}] [:dx/put [{:person/id :ivan :name "ivan" :age 30} ...]]
entire map, without entity id
[:dx/put [:person/id :ivan] {:name "ivan" :age 30}]
ident|s
[:dx/put [:person/id :ivan] :friend [:person/id :petr]]
[:dx/put [:person/id :ivan] :friend [[:person/id :petr] ...]]
reference map|s
[:dx/put [:person/id :ivan] :friend {:person/id :petr :name "petr"}]
[:dx/put [:person/id :ivan] :friend [{:person/id :petr :name "petr"} ...]]
key value
[:dx/put [:person/id :ivan] :age 12]
delete: ident [:dx/delete [:person/id :ivan]]
entity|s
[:dx/delete {:person/id :ivan ...}]
[:dx/delete [{:person/id :ivan ...} ...]]
key
[:dx/delete [:person/id :ivan] :age]
value - like disj
[:dx/delete [:person/id :ivan] :aka "tupen"]
conj: value [:dx/conj [:person/id :ivan] :aka "tupen"]
ident|s
[:dx/conj [:person/id :ivan] :friend [:person/id :petr]]
[:dx/conj [:person/id :ivan] :friend [[:person/id :petr] ...]]
entity|s
[:dx/conj [:person/id :ivan] :friend {:person/id :petr ...}]
[:dx/conj [:person/id :ivan] :friend [{:person/id :petr ...} ...]]
update: entity [:dx/update [:person/id :ivan] (fn [entity] (f entity)]
key
[:dx/update [:person/id :ivan] :age inc]
match: entity [:dx/match [:person/id :ivan] {:person/id :ivan ...}]
key value
[:dx/match [:person/id :ivan] :age 30]
key fn
[:dx/match [:person/id :ivan] :salary #(> % 10000)]
apply transactions to db. txs can be either a single transaction or a vector of transactions. returns a modified db. transaction report is stored in the db metadata. usage: [:dx/put|delete|conj|update|match [table eid] ?m | (?k ?v)] put: entire map|s with entity id [:dx/put {:person/id :ivan :name "ivan" :age 30}] [:dx/put [{:person/id :ivan :name "ivan" :age 30} ...]] entire map, without entity id [:dx/put [:person/id :ivan] {:name "ivan" :age 30}] ident|s [:dx/put [:person/id :ivan] :friend [:person/id :petr]] [:dx/put [:person/id :ivan] :friend [[:person/id :petr] ...]] reference map|s [:dx/put [:person/id :ivan] :friend {:person/id :petr :name "petr"}] [:dx/put [:person/id :ivan] :friend [{:person/id :petr :name "petr"} ...]] key value [:dx/put [:person/id :ivan] :age 12] delete: ident [:dx/delete [:person/id :ivan]] entity|s [:dx/delete {:person/id :ivan ...}] [:dx/delete [{:person/id :ivan ...} ...]] key [:dx/delete [:person/id :ivan] :age] value - like disj [:dx/delete [:person/id :ivan] :aka "tupen"] conj: value [:dx/conj [:person/id :ivan] :aka "tupen"] ident|s [:dx/conj [:person/id :ivan] :friend [:person/id :petr]] [:dx/conj [:person/id :ivan] :friend [[:person/id :petr] ...]] entity|s [:dx/conj [:person/id :ivan] :friend {:person/id :petr ...}] [:dx/conj [:person/id :ivan] :friend [{:person/id :petr ...} ...]] update: entity [:dx/update [:person/id :ivan] (fn [entity] (f entity)] key [:dx/update [:person/id :ivan] :age inc] match: entity [:dx/match [:person/id :ivan] {:person/id :ivan ...}] key value [:dx/match [:person/id :ivan] :age 30] key fn [:dx/match [:person/id :ivan] :salary #(> % 10000)]
(commit! db_ txs)
(commit! db_ txs tx-meta)
accepts an atom with db, see commit
accepts an atom with db, see `commit`
(comp-some & fns)
returns a vector even if the argument is nil
returns a vector even if the argument is nil
(create-dx)
(create-dx data)
(create-dx data {:keys [with-diff?] :as opts})
creates a db, can take a map, which is written to the metadata
creates a db, can take a map, which is written to the metadata
(datalog->meander {:keys [where in args] :as q})
(db-with data)
(db-with db data)
(delete-cached-results! db kw)
(denormalize data)
(denormalize db data)
(denormalize db data max-level)
turns a flat map into a nested one. to avoid stackoverflow and infinite loop, it takes a maximum nesting level as an additional argument
turns a flat map into a nested one. to avoid stackoverflow and infinite loop, it takes a maximum nesting level as an additional argument
(execute-q q' db & args)
(get-dx k)
(get-dx! k)
(haul db)
(haul db x)
(haul db x max-level)
returns a map even if the argument is nil
returns a map even if the argument is nil
(listen! db_ cb)
(listen! db_ k cb)
listens for changes in the db. each time changes are made via commit, the callback is called with the db. the transaction report is written to the db metadata, and may include, depending on the configuration, the transaction time, the difference between the old and new db, the db hash. calling listen twice with the same k overwrites the previous callback.
listens for changes in the db. each time changes are made via commit, the callback is called with the db. the transaction report is written to the db metadata, and may include, depending on the configuration, the transaction time, the difference between the old and new db, the db hash. calling listen twice with the same k overwrites the previous callback.
(normalize data)
turns a nested map into a flat collection with references.
turns a nested map into a flat collection with references.
(parse-find args)
(parse-query q & args)
(parse-query-elem elem args-map)
(patch db edits)
(patch db edits time)
patch db using ediscript edits
patch db using ediscript edits
(patch! db_ edits)
(patch! db_ edits time)
patch db inside atom, see patch
patch db inside atom, see `patch`
(pull db query)
(pull db query id)
(pull* db query)
(pull* db query parent)
(pull-one db query)
(pull-one db query id)
(q q' db & args)
(qsymbol? x)
(query args)
(reg-dx! id store)
(reverse-search db id)
(reverse-search db k id)
(valid-id? id)
(with-dx bindings & body)
(with-dx! bindings & body)
(with-time-ms & body)
macro establishes the execution time of the body and returns a result with
attached metadata, with key execution-time
in milliseconds
macro establishes the execution time of the body and returns a result with attached metadata, with key `execution-time` in milliseconds
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close