lmdb_master_sys

Function mdb_env_set_maxdbs

Source
pub unsafe extern "C" fn mdb_env_set_maxdbs(
    env: *mut MDB_env,
    dbs: MDB_dbi,
) -> c_int
Expand description

Set the maximum number of named databases for the environment.

This function is only needed if multiple databases will be used in the environment. Simpler applications that use the environment as a single unnamed database can ignore this option. This function may only be called after #mdb_env_create() and before #mdb_env_open().

Currently a moderate number of slots are cheap but a huge number gets expensive: 7-120 words per transaction, and every #mdb_dbi_open() does a linear search of the opened slots.

§Arguments

  • env (direction in) - An environment handle returned by #mdb_env_create()
  • dbs (direction in) - The maximum number of databases

§Returns

A non-zero error value on failure and 0 on success. Some possible errors are:

  • EINVAL - an invalid parameter was specified, or the environment is already open.