A lightweight adapter (v0.1.0) that enables Drizzle ORM (≥0.44.0) to use Node's built-in `node:sqlite` module, eliminating the need for native bindings like `better-sqlite3`. It wraps Drizzle's SQLite Proxy driver, converting row shapes to match Drizzle's expected array format (especially on Node 22 where rows are objects). Released as stable, with active development. Ideal for Node 22.5+ and works in Electron main/preload scripts. Key differentiator: zero native dependencies, leveraging Node's native SQLite for a pure JS ORM stack. Release cadence: patch fixes as needed.
npm install drizzle-orm-node-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes Drizzle with node:sqlite, creates a table, inserts a row, and queries using relational helpers.
Upgrade to Node 22.5+ or use a different SQLite driver like better-sqlite3 with drizzle-orm/better-sqlite3.
If on Node 24+, ensure `DatabaseSync` is created without `returnArrays: true` unless adapter updated. Stick to Node 22 for predictable behavior.
Use `import()` (top-level await or async) or set `"type": "module"` in package.json.
Pass `schema` object (usually imported from your schema file) in the options.
Stay updated with adapter releases; if you rely on bigint, explicitly set `readBigInts: true`.
Generate SQL migrations with `drizzle-kit generate` and run with `db.run(sql)` or use `migrate` function from drizzle-orm/node-sqlite? Check documentation.
Replace `require('drizzle-orm-node-sqlite')` with `await import('drizzle-orm-node-sqlite')` or convert project to ESM.Call `drizzle({ client: ':memory:' })` instead of `drizzle(':memory:')`.Pass your schema object: `drizzle({ client: DB_PATH, schema })`.Upgrade Node to >=22.5.0 or use a different adapter.
Install both `drizzle-orm` and `drizzle-orm-node-sqlite`. Ensure tsconfig `moduleResolution` is set to `NodeNext` or `Bundler`, and that `types: ["node"]` includes `@types/node`.