Skip to content

basalt / permissions-sqlite/src / openPermissionsDatabase

Function: openPermissionsDatabase() ​

> openPermissionsDatabase(location?): DatabaseSync

Defined in: permissions-sqlite/src/index.ts:24

Durable, SQLite-backed implementation of the @basaltkit/permissionsAccessStore, on Node's built-in node:sqlite. Zero external dependencies. The single-node reference backend; the production (Postgres/MySQL) counterpart is @basaltkit/permissions-prisma.

Role assignments and permission grants are sets — every write is an INSERT OR IGNORE, so re-granting is a harmless no-op. The same database also backs the durable TemporaryGrantStore and DelegationStore (SqliteTemporaryGrantStore, SqliteDelegationStore).

Requires Node 22.5+ (stable and flag-free on Node 24; --experimental-sqlite on 22.x).

Parameters ​

location? ​

string = ':memory:'

Returns ​

DatabaseSync

Released under the MIT License.