Skip to main content

Storage paths

@liorandb/core uses a single "root folder" where all database directories are stored.

Default root path

If you do not pass rootPath to LioranManager, the default root is:

  • process.env.LIORANDB_PATH if set, otherwise
  • ~/LioranDB/db

The directory is created automatically if it does not exist.

getBaseDBFolder()

getBaseDBFolder(): string

Returns the resolved default root folder path used by the embedded engine.

Example: print the default root folder

import { getBaseDBFolder } from "@liorandb/core";

console.log(getBaseDBFolder());
Sandbox output (example)
/home/you/LioranDB/db

Example: project-local root folder

import { LioranManager } from "@liorandb/core";

const manager = new LioranManager({ rootPath: "./.liorandb" });
await manager.db("app");
await manager.close();
Sandbox output (example)
(creates ./\.liorandb/app on disk)