mdb_env_set_maxdbs function

int mdb_env_set_maxdbs(
  1. Pointer<MDB_env> env,
  2. int dbs
)

@brief 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. @paramin env An environment handle returned by #mdb_env_create() @paramin dbs The maximum number of databases @return 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.

Implementation

@ffi.FfiNative<ffi.Int Function(ffi.Pointer<MDB_env>, MDB_dbi)>(
    'mdb_env_set_maxdbs')
external int mdb_env_set_maxdbs(
  ffi.Pointer<MDB_env> env,
  int dbs,
);