@entitykit/sqlite
v0.1.0-alpha.1
Published
The SQLite provider for EntityKit, backed by the Node.js built-in node:sqlite driver.
Maintainers
Readme
The provider uses node:sqlite: no native addon or separate database driver is
required. Core loads it only when a context selects SQLite.
Install
npm install @entitykit/core@alpha @entitykit/sqlite@alphaConfigure
import { DbContext, type DbContextOptionsBuilder } from "@entitykit/core";
class AppDbContext extends DbContext {
protected override configure(options: DbContextOptionsBuilder): void {
options.useSqlite("./app.db");
}
}Use ":memory:" for an isolated in-memory database:
options.useSqlite(":memory:");Typed configuration also supports read-only access, foreign-key enforcement, busy timeout, and journal mode.
Direct provider API
The package exports sqliteProviderServices, createSqliteDataSource,
SqliteDatabaseConnection, SqliteSchemaIntrospector, SQLite runtime and
migration dialects, the SQLite value reader, and a standalone parameterized
rawSql tag.
import { sqliteProviderServices } from "@entitykit/sqlite";
options.useProvider(sqliteProviderServices, { filename: "./app.db" });Boundaries
EntityKit requires Node 22.13 or newer. Some Node 22 releases still print an
informational ExperimentalWarning when node:sqlite loads.
SQLite migration changes that cannot be expressed with ALTER TABLE use a
modeled table rebuild. SQLite has no migration advisory lock and supports only
serializable and readUncommitted isolation through EntityKit. Review the
complete provider boundary.
License
MIT
