Library
Module
Module type
Parameter
Class
Class type
OCaml binding for LMDB.
The LMDB database is a fast in-file database that supports ACID transactions.
These bindings attempts to expose a typesafe yet low-overhead API.
First, an environment must be open using Env.create
:
let env = Env.create "mydb"
Database implementations are specialized both by keys and values and answer the S
signature. Two module are predefined:
Using Db
, we can open a new database and add our first value:
let db = Db.create ~create:true env "Camelidae" in
Db.put db "Bactrian camel" "Elegant and beautiful animal with two humps."
Transactions and Iterators are also available.
You can define new database implementations using the Make
functor.
module Env : sig ... end
Operations on environment.
module PutFlags : sig ... end
Flags usable with the put
operation.
module type S = sig ... end
Main signature for a database module.
Database with string keys and string elements.
Database with integer keys and string elements.
exception Error of error
Error are reported with this exception or with Not_found
.
val pp_error : Stdlib.Format.formatter -> error -> unit
pp_error Format.std_formatter e
will print a human-readable description of the given error.
module Values : sig ... end