Liking cljdoc? Tell your friends :D

dat.api


clear!clj

(clear! db)
source

close!clj

(close! db)
source

connclj

(conn db)

Returns the underlying backend connection (a datalevin.core or datascript.core conn), for backend-specific operations dat.api doesn't wrap, e.g. datalevin.core/listen! or datalevin.core/entity.

Returns the underlying backend connection (a datalevin.core or
datascript.core conn), for backend-specific operations dat.api doesn't
wrap, e.g. datalevin.core/listen! or datalevin.core/entity.
sourceraw docstring

init!clj

(init! db-type schema db-opts)
source

pullclj

(pull derefed-db selector eid)
source

qclj

(q query derefed-db & args)
source

register-fn!clj

(register-fn! db ident f)

Registers a transaction function f under ident, so that tx-data entries of the form [ident & args] invoke it as a transaction function.

For :dat.db/datalevin, f must be built with datalevin.interpret/inter-fn at the call site (it needs to see the literal fn form to make it serializable), and its args are [db & args].

Registers a transaction function `f` under `ident`, so that tx-data
entries of the form `[ident & args]` invoke it as a transaction function.

For :dat.db/datalevin, `f` must be built with `datalevin.interpret/inter-fn`
at the call site (it needs to see the literal `fn` form to make it
serializable), and its args are `[db & args]`.
sourceraw docstring

transact!clj

(transact! db txs)
source

uuidclj

(uuid)
source

with-transactioncljmacro

(with-transaction [tx-db db] & body)

Runs body as a single atomic transaction. tx-db is a db to be used in place of db for transact!, q and pull within body. If body throws, all its writes are rolled back.

Runs `body` as a single atomic transaction. `tx-db` is a db to be used
in place of `db` for `transact!`, `q` and `pull` within `body`.
If `body` throws, all its writes are rolled back.
sourceraw docstring

with-transaction-fnclj

(with-transaction-fn db f)
source

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