Registry / database / drizzle-sqlite

drizzle-sqlite

JSON →
library0.0.1jsnpmunverified

Drizzle ORM adapter for Node.js built-in SQLite driver. Current stable version 0.0.1, daily releases under active development. Provides a type-safe SQLite query builder and ORM leveraging the native sqlite module available in Node.js v24+. Key differentiator: zero extra dependencies beyond drizzle-orm, uses Node's built-in driver instead of sql.js or better-sqlite3. Primarily for server-side Node.js applications targeting modern Node versions.

database
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM-only package. CommonJS require will fail.

import { drizzle } from 'drizzle-sqlite'

Database is a type export, not runtime value. Use type import.

import type { Database } from 'drizzle-sqlite'

DrizzleConfig is a type export for configuration options.

import type { DrizzleConfig } from 'drizzle-sqlite'

Initializes an in-memory SQLite database using Node.js built-in driver, creates a table, inserts data, and queries via Drizzle ORM.

import { drizzle } from 'drizzle-sqlite'; import { DatabaseSync } from 'node:sqlite'; const sqlite = new DatabaseSync(':memory:'); sqlite.exec(`CREATE TABLE users ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT UNIQUE )`); const db = drizzle(sqlite); // Insert a user const insertStmt = sqlite.prepare('INSERT INTO users (name, email) VALUES (?, ?)'); insertStmt.run('Alice', 'alice@example.com'); insertStmt.run('Bob', 'bob@example.com'); // Query using Drizzle ORM import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core'; const users = sqliteTable('users', { id: integer('id').primaryKey(), name: text('name'), email: text('email'), }); const result = db.select({ name: users.name, email: users.email }).from(users).all(); console.log(result);
Debug
Known footguns
breakingRequires Node.js v24+ (built-in sqlite module)
gotchaESM-only package; CommonJS require will throw ERR_REQUIRE_ESM
gotchaDatabase and DrizzleConfig are type-only exports, not runtime constructs
deprecatedDepends on drizzle-orm ^0.45.2; incompatible with major version >0.45.x
gotchaNode.js built-in sqlite DatabaseSync and DatabaseAsync APIs are experimental and may change
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
bingbot
1
mj12bot
1
ahrefsbot
1
Resources