recommend · verified 2026-09-08
TypeScript query layer for SQLite, Drizzle vs Prisma vs Kysely
pick Drizzle ORM 0.45.2
Drizzle ORM 0.45.2. SQLite is a first-class dialect, migrations are plain SQL files you can read in a pull request, and the driver list covers better-sqlite3, node:sqlite, Bun, and Turso, so the same schema moves from a local file to hosted SQLite. Kysely 0.29.5 is the better pick if you want a query builder and nothing else, with no migration tooling opinions attached.
alternative · Kysely
Prisma gives you a generated client and Prisma Studio, which is the friendlier path if you would rather not write SQL.
Wins when you want a GUI over the data and a generated client more than control over the query.
traps for Drizzle ORM (3)
| severity | versions | symptom and fix |
|---|---|---|
| major | >=0.30.0 | Two app replicas start at once and both run migrations; the second fails on an already-applied step. Run `migrate()` behind `pg_advisory_lock(<constant>)` in one process (a jobs container or a release step), never in every web replica's startup. |
| major | >=1.0.0-beta.1 | Installing `drizzle-orm@rc` pulls 1.0.0-rc.5 and SQLiteSyncDialect no longer exists. The 1.0 line splits SQLite into async and effect variants, removes `SQLiteSyncDialect` and `SQLiteAsyncDialect` in favour of `migrateSync` and `migrateAsync` under `sqlite-core/async/session`, and drops relational queries v1 from SQLite. The npm `latest` tag is still 0.45.2, so a plain install stays on the stable line; only the `rc` tag gets you 1.0. evidence |
| minor | >=0.30.0 | Selecting into a destructured tuple with `noUncheckedIndexedAccess` produces a type error on the first row. Read `rows[0]?.field ?? fallback` instead of destructuring `const [{ field }] = rows`. |
what your agent receives
VERDICT TypeScript query layer for SQLite, Drizzle vs Prisma vs Kysely PICK Drizzle ORM 0.45.2: Drizzle ORM 0.45.2. SQLite is a first-class dialect, migrations are plain SQL files you can read in a pull request, and the driver list covers better-sqlite3, node:sqlite, Bun, and Turso, so the same schema moves from a local file to hosted SQLite. Kysely 0.29.5 is the better pick if you want a query builder and nothing else, with no migration tooling opinions attached. ALT Kysely: Prisma gives you a generated client and Prisma Studio, which is the friendlier path if you would rather not write SQL.; wins when you want a GUI over the data and a generated client more than control over the query TRAPS (3) [5f5f7185] major: Two app replicas start at once and both run migrations; the second fails on an already-applied step. [09f0b33a] major: Installing `drizzle-orm@rc` pulls 1.0.0-rc.5 and SQLiteSyncDialect no longer exists. [b7dc865f] minor: Selecting into a destructured tuple with `noUncheckedIndexedAccess` produces a type error on the first row. VERIFIED 2026-09-08 by wellworn reviewer · recheck 2027-01-06 · sources 5