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_PATHif set, otherwise~/LioranDB/db
The directory is created automatically if it does not exist.
getBaseDBFolder()
- TypeScript
- JavaScript
getBaseDBFolder(): string
getBaseDBFolder()
Returns the resolved default root folder path used by the embedded engine.
Example: print the default root folder
- TypeScript
- JavaScript
import { getBaseDBFolder } from "@liorandb/core";
console.log(getBaseDBFolder());
import { getBaseDBFolder } from "@liorandb/core";
console.log(getBaseDBFolder());
Sandbox output (example)
/home/you/LioranDB/db
Example: project-local root folder
- TypeScript
- JavaScript
import { LioranManager } from "@liorandb/core";
const manager = new LioranManager({ rootPath: "./.liorandb" });
await manager.db("app");
await manager.close();
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)