Module Lmdb__.Lmdb_bindings

type bigstring = (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
val version : string * int * int * int

Exceptions

exception Exists
exception Map_full
exception Error of int
val strerror : int -> string

Flags

module type Flags = sig ... end

Operations on sets of flags.

module Flags : Flags

Environment

type env
module EnvFlags : sig ... end
module CopyFlags : sig ... end
val env_create : unit -> env
val env_open : env -> string -> EnvFlags.t -> int -> unit
val env_close : env -> unit
val env_set_mapsize : env -> int -> unit
val env_set_maxdbs : env -> int -> unit
val env_set_maxreaders : env -> int -> unit
val env_copy : env -> string -> CopyFlags.t -> unit
val env_copyfd : env -> Unix.file_descr -> CopyFlags.t -> unit
val env_set_flags : env -> EnvFlags.t -> bool -> unit
val env_get_flags : env -> EnvFlags.t
val env_get_path : env -> string
val env_get_fd : env -> Unix.file_descr
val env_sync : env -> bool -> unit
val env_get_maxreaders : env -> int
val env_get_maxkeysize : env -> int
val reader_list : env -> (string -> int) -> int
val reader_check : env -> int
type stat = {
psize : int;
depth : int;
branch_pages : int;
leaf_pages : int;
overflow_pages : int;
entries : int;
}
val env_stat : env -> stat
type envinfo = {
map_addr : int;

To recover the actual address this integer needs to be shifted to the left by one bit. A 31 bit integer may overflow.

map_size : int;
last_pgno : int;
last_txnid : int;
max_readers : int;
num_readers : int;
}
val env_info : env -> envinfo

Transaction

type txn
val txn_env : txn -> env
val txn_begin : env -> txn option -> EnvFlags.t -> txn
val txn_commit : txn -> unit
val txn_abort : txn -> unit

Dbi

type dbi
val invalid_dbi : dbi
module DbiFlags : sig ... end
module PutFlags : sig ... end
module Block_option : sig ... end
val dbi_open : txn -> string option -> DbiFlags.t -> dbi
val dbi_close : env -> dbi -> unit
val dbi_flags : txn -> dbi -> DbiFlags.t
val dbi_stat : txn -> dbi -> stat
val drop : txn -> dbi -> bool -> unit
val get : txn -> dbi -> bigstring -> bigstring
val put : txn -> dbi -> bigstring -> bigstring -> PutFlags.t -> unit
val put_reserve : txn -> dbi -> bigstring -> int -> PutFlags.t -> bigstring
val del : txn -> dbi -> bigstring -> bigstring Block_option.t -> unit
val cmp : txn -> dbi -> bigstring -> bigstring -> int
val dcmp : txn -> dbi -> bigstring -> bigstring -> int

Cursor

type cursor
module Ops : sig ... end
val cursor_open : txn -> dbi -> cursor
val cursor_close : cursor -> unit
val cursor_put : cursor -> bigstring -> bigstring -> PutFlags.t -> unit
val cursor_put_reserve : cursor -> bigstring -> int -> PutFlags.t -> bigstring
val cursor_del : cursor -> PutFlags.t -> unit
val cursor_get : cursor -> bigstring Block_option.t -> bigstring Block_option.t -> Ops.t -> bigstring * bigstring
val cursor_count : cursor -> int

Internal

val sizeof_int : int
val sizeof_size_t : int