package lmdb

  1. Overview
  2. Docs

Operations on environment.

type t

A DB environment supports multiple databases, all residing in the same shared-memory map.

module Flags : sig ... end
val create : ?max_readers:int -> ?map_size:int -> ?max_dbs:int -> ?flags:Flags.t -> ?mode:int -> string -> t

create "/mydb" create an environment in the directory mydb/ and return an handle Env.t. The returned handle will be closed automatically when the OCaml handle is garbage collected.

  • parameter map_size

    Size of the memory map.

  • parameter max_readers

    Maximum number of threads/reader slots.

  • parameter max_dbs

    Maximum number of named database.

  • parameter mode

    The UNIX permissions to set on created files and semaphores. Default is 0o755.

val copy : ?compact:bool -> t -> string -> unit
val copyfd : ?compact:bool -> t -> Unix.file_descr -> unit
val set_flags : t -> Flags.t -> bool -> unit
val flags : t -> Flags.t
val set_map_size : t -> int -> unit
val path : t -> string
val fd : t -> Unix.file_descr
val sync : ?force:bool -> t -> unit
type stats = {
  1. psize : int;
  2. depth : int;
  3. branch_pages : int;
  4. leaf_pages : int;
  5. overflow_pages : int;
  6. entries : int;
}
val stats : t -> stats
val max_readers : t -> int
val max_keysize : t -> int
val reader_list : t -> string list
val readers : t -> int
OCaml

Innovation. Community. Security.