Crate sanakirja [] [src]

Fast and reliable key-value store, under the Mozilla Public License (link as you like, share modifications).

Features

  • ACID semantics.

  • B trees with copy-on-write.

  • Support for referential transparency: databases can be cloned in time O(1).

  • Ultimately, we'd like to have no locks. Right now, there is a cross-process read write lock, that only commit takes exclusively (other parts of a mutable transaction need just a read access).

This version is only capable of inserting and retrieving keys in the database, allowing several bindings for the same key (get will retrieve the first one).

Modules

value

Values, which might be either inlined on the page, or stored as a reference if too large.

Structs

Cursor

An iterator over a database.

Db

A database is a skip list of (page offset, key, value).

Env

Environment, required to start any transactions. Thread-safe, but opening the same database several times in the same process is not cross-platform.

Iter

Iterator on a page, plus a middle element immediately after off, with a fixed left and right child.

MutTxn

A mutable transaction.

Txn

An immutable transaction.

Enums

Alignment

Alignment of representables on page. The only implication is on how the write_value and read_value methods are going to be implemented.

Error

Errors that can occur while transacting.

Traits

Commit

Transactions that can be committed.

Representable

Types that can be stored in a Sanakirja database, as keys or values. Some care must be taken when storing things.

Transaction

Trait for operations common to mutable and immutable transactions.

Functions

debug

Dumps a number of databases into a dot file.