(batch db)
(batch db {puts :put deletes :delete})
Batch a collection of put and/or delete operations into the supplied db
.
Takes a map of the form {:put [key1 value1 key2 value2] :delete [key3 key4]}
.
If :put
key is provided, it must contain an even-length sequence of alternating keys and values.
Batch a collection of put and/or delete operations into the supplied `db`. Takes a map of the form `{:put [key1 value1 key2 value2] :delete [key3 key4]}`. If `:put` key is provided, it must contain an even-length sequence of alternating keys and values.
(bounds db)
Returns a tuple of the lower and upper keys in the database or snapshot.
Returns a tuple of the lower and upper keys in the database or snapshot.
(compact db)
(compact db start)
(compact db start end)
Forces compaction of database over the given range. If start
or end
are nil, they default to
the full range of the database.
Forces compaction of database over the given range. If `start` or `end` are nil, they default to the full range of the database.
(create-db directory
{:keys [key-decoder key-encoder val-decoder val-encoder
create-if-missing? error-if-exists? write-buffer-size
block-size max-open-files cache-size comparator compress?
paranoid-checks? block-restart-interval logger]
:or {cache-size 32
block-size (* 16 1024)
val-decoder identity
create-if-missing? true
key-decoder identity
key-encoder identity
write-buffer-size (* 32 1024 1024)
error-if-exists? false
compress? true
val-encoder identity}
:as options})
Creates a closeable database object, which takes a directory and zero or more options.
The key and val encoder/decoders are functions for transforming to and from byte-arrays.
Creates a closeable database object, which takes a directory and zero or more options. The key and val encoder/decoders are functions for transforming to and from byte-arrays.
(delete db)
(delete db key)
(delete db key & keys)
Deletes one or more keys in the given db
.
Deletes one or more keys in the given `db`.
(destroy-db directory)
Destroys the database at the specified directory
.
Destroys the database at the specified `directory`.
(get db key)
(get db key default-value)
Returns the value of key
for the given database or snapshot. If the key doesn't exist, returns
default-value
or nil.
Returns the value of `key` for the given database or snapshot. If the key doesn't exist, returns `default-value` or nil.
(iterator db)
(iterator db start)
(iterator db start end)
Returns a closeable sequence of map entries (accessed with key
and val
) that is the inclusive
range from start
to end
. If exhausted, the sequence is automatically closed.
Returns a closeable sequence of map entries (accessed with `key` and `val`) that is the inclusive range from `start `to `end`. If exhausted, the sequence is automatically closed.
(put db)
(put db key val)
(put db key val & key-vals)
Puts one or more key/value pairs into the given db
.
Puts one or more key/value pairs into the given `db`.
(reverse-iterator db)
(reverse-iterator db start)
(reverse-iterator db start end)
Returns a closeable sequence of map entries (accessed with key
and val
) that is the inclusive
range from start
to end
in reverse order. If exhausted, the sequence is automatically closed.
Returns a closeable sequence of map entries (accessed with `key` and `val`) that is the inclusive range from `start `to `end` in reverse order. If exhausted, the sequence is automatically closed.
(snapshot db)
Returns a snapshot of the database that can be used with get
and iterator
. This implements
java.io.Closeable, and can leak space in the database if not closed.
Returns a snapshot of the database that can be used with `get` and `iterator`. This implements java.io.Closeable, and can leak space in the database if not closed.
(stats db property)
Returns statistics for the database.
Returns statistics for the database.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close