Skip to content

init

init(dbDir?): void

Defined in: .work/repos/olmdb/src/olmdb.ts:237

Initialize the database with the specified directory path. This function may be called multiple times with the same parameters. If it is not called before the first transact(), the database will be automatically initialized with the default directory.

string

Optional directory path for the database (defaults to environment variable $OLMDB_DIR or ”./.olmdb”).

void

With code “INCONSISTENT_INIT” if database is already initialized with different parameters.

With code “CREATE_DIR_FAILED” if directory creation fails.

With code “LMDB-{code}” for LMDB-specific errors.

init("./my-database");