Liking cljdoc? Tell your friends :D

xitdb.db


*return-history?*clj


append-context!clj

(append-context! history slot fn)

Appends a new history context and calls fn with a write cursor. Returns the new history index.

Appends a new history context and calls `fn` with a write cursor.
Returns the new history index.
raw docstring

db-historyclj

(db-history db)

history-indexclj

(history-index xdb)

Returns the current size of the transaction history array.

Returns the current size of the transaction history array.
raw docstring

materializeclj


open-databaseclj

(open-database filename open-mode)

Opens database filename. If filename is :memory, returns a memory based db. open-mode can be r or rw.

Opens database `filename`.
If `filename` is `:memory`, returns a memory based db.
open-mode can be `r` or `rw`.
raw docstring

read-historyclj

(read-history db)

Returns the read only transaction history array.

Returns the read only transaction history array.
raw docstring

v->slot!clj

(v->slot! cursor v)

Converts a value to a slot which can be written to a cursor. For XITDB* types (which support ISlot), will return -slot, for all other types conversion/v->slot!

Converts a value to a slot which can be written to a cursor.
For XITDB* types (which support ISlot), will return `-slot`,
for all other types `conversion/v->slot!`
raw docstring

xdb-cursorclj

(xdb-cursor xdb keypath)

xit-dbclj

(xit-db filename)

Returns a new XITDBDatabase which can be used to query and transact data. filename can be :memory or the name of a file on the filesystem. If the file does not exist, it will be created. The returned database handle can be used from multiple threads. Reads can run in parallel, transactions (eg. swap!) will only allow one writer at a time.

Returns a new XITDBDatabase which can be used to query and transact data.
`filename` can be `:memory` or the name of a file on the filesystem.
If the file does not exist, it will be created.
The returned database handle can be used from multiple threads.
Reads can run in parallel, transactions (eg. `swap!`) will only allow one writer at a time.
raw docstring

xitdb-reset!clj

(xitdb-reset! history new-value)

Sets the value of the database to new-value. Returns new history index.

Sets the value of the database to `new-value`.
Returns new history index.
raw docstring

xitdb-swap!clj

(xitdb-swap! db base-keypath f & args)

Starts a new transaction and calls f with the value at base-keypath. If base-keypath is nil, will use the root cursor. f will receive a XITDBWrite* type with the value at base-keypath and args. Actions on the XITDBWrite* type (like assoc) will mutate it. Return value of f is written at base-keypath (or root) cursor. Returns the transaction history index.

Starts a new transaction and calls `f` with the value at `base-keypath`.
If `base-keypath` is nil, will use the root cursor.
`f` will receive a XITDBWrite* type with the value at `base-keypath` and `args`.
Actions on the XITDBWrite* type (like `assoc`) will mutate it.
Return value of `f` is written at `base-keypath` (or root) cursor.
Returns the transaction history index.
raw docstring

xitdb-swap-with-lock!clj

(xitdb-swap-with-lock! xitdb base-keypath f & args)

Performs the 'swap!' operation while locking db.lock. Returns the new value of the database. If the binding *return-history?* is true, returns [current-history-index db-before db-after]. If keypath is not empty, the result of f will be written to the db at keypath rather than db root. Similarly, if keypath is not empty, the returned value will be the value at keypath.

Performs the 'swap!' operation while locking `db.lock`.
Returns the new value of the database.
If the binding `*return-history?*` is true, returns
`[current-history-index db-before db-after]`.
If `keypath` is not empty, the result of `f` will be written to the db at `keypath` rather
than db root.
Similarly, if `keypath` is not empty, the returned value will be the value at `keypath`.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close