Module Lmdb

High level bindings for LMDB.

Raw bindings

Permissions

type 'a perm =
| Ro : [ `Read ] perm
| Rw : [ `Read | `Write ] perm

This library uses [< `Read | `Write ] phantom types to encode the read/write permissions of transactions and cursors. The following values are used to request read-only or read-write permissions on environments, transactions and cursors.

Database

module Env : sig ... end

Collection of maps stored in a single memory-mapped file.

module Txn : sig ... end

Series of operations on an environment performed atomically.

module Conv : sig ... end

Converters to and from the internal representation of keys and values. A converter contains serialising and deserialising functions as well as the flags applied when the converter is used in a map.

module Map : sig ... end

Key-value maps.

module Cursor : sig ... end

Iterators over maps.

Error reporting

exception Exists

Raised when adding an already existing key to a `Uni map or adding an an already existing value with Map.Flags.no_dup_data to a key of a `Dup map.

Also raised when trying to add ~flags:Flags.append(_dup) non-sorted data.

exception Not_found

Raised when searching for non-existing key

exception Map_full

Raised when memory map is full

exception Error of int

Other errors are reported with Invalid_arg s or Error n.

val pp_error : Stdlib.Format.formatter -> int -> unit

pp_error Format.std_formatter e prepares a human-readable description of the given error code n raised via Error n.

val version : string * int * int * int

(name, major, minor, patch)