clj-leveldb documentation

->Batch

fn

[db batch key-encoder val-encoder options]

Positional factory function for class clj_leveldb.Batch.

->LevelDB

fn

[db key-decoder key-encoder val-decoder val-encoder]

Positional factory function for class clj_leveldb.LevelDB.

->Snapshot

fn

[db key-decoder key-encoder val-decoder read-options]

Positional factory function for class clj_leveldb.Snapshot.

approximate-size

fn

[db]
[db start end]

Returns an estimate of the size of entries, in bytes, inclusively between start and end.

bounds

fn

[db]

Returns a tuple of the lower and upper keys in the database or snapshot.

compact

fn

[db]
[db start]
[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.

create-db

fn

[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 {val-encoder identity, error-if-exists? false, val-decoder identity, block-size (* 16 1024), key-encoder identity, create-if-missing? true, key-decoder identity, cache-size (* 32 1024 1024), write-buffer-size (* 32 1024 1024), compress? true}, :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.

delete

fn

[db]
[db key]
[db key & keys]

Deletes one or more keys in the given db.

destroy-db

fn

[directory]

Destroys the database at the specified directory.

get

fn

[db key]
[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.

iterator

fn

[db]
[db start]
[db start end]

Returns a closeable sequence of map entries (accessed with key and val) that is the inclusive range from startto end. If exhausted, the sequence is automatically closed.

map->Batch

fn

[m__5818__auto__]

Factory function for class clj_leveldb.Batch, taking a map of keywords to field values.

map->LevelDB

fn

[m__5818__auto__]

Factory function for class clj_leveldb.LevelDB, taking a map of keywords to field values.

map->Snapshot

fn

[m__5818__auto__]

Factory function for class clj_leveldb.Snapshot, taking a map of keywords to field values.

put

fn

[db]
[db key val]
[db key val & key-vals]

Puts one or more key/value pairs into the given db.

repair-db

fn

[directory]

Repairs the database at the specified directory.

snapshot

fn

[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.

stats

fn

[db property]

Returns statistics for the database.

sync

fn

[db]

Forces the database to fsync.