Database Access & ORMs
How your code reads and writes the database — typed queries, schema changes and migrations — once you've picked where the data lives.
The real choice
Schema-first ORM, SQL-shaped query builder, or the platform's own SDK. A schema-first ORM generates types and migrations from one schema file and hides the SQL; a SQL-shaped ORM or query builder keeps queries close to SQL with full types and a smaller runtime; a backend platform (Supabase, Convex, Firebase) comes with its own client, and adding an ORM on top is often unnecessary.
Pick by situation
Tap the ones that are you — the tools that fit light up below.- You want one schema file that generates types, migrations and a readable query API
Prisma - You deploy to serverless or edge functions and want queries that read like SQL, fully typed
Drizzle ORM - You already write SQL comfortably and only want types around it, no schema layer
Kysely - Your backend is Python and not Django
SQLAlchemy
The contenders
Grouped by the side of the choice they answer, not ranked. Open a row for when to use it, the trade-off and what makers say.
Prismalibrary · open source · free tierA schema-first ORM with generated types and migrations.

37+111 open source15.9M/wk+1% vs npm
Use it whenYou want to describe the schema in one file and have types and migrations generated from it.
Trade-offA generated client and its own schema language sit between you and SQL; complex queries often drop back to raw SQL.
llms.txtMCPCLIUsed by Chat Thing, documenso, Firecoach AI, FraudLens AI, Hardbook and 32 more · in 111 open-source projects.
Since a year I build all my products with Prisma. It is a huge time saver and I like having the overview in one single file. It's migration just works all the time. Thanks Prisma!
Drizzle ORMlibrary · open source · free tierA thin, SQL-like TypeScript ORM that runs well on serverless and edge runtimes.

10+136 open source18.1M/wk+167% vs npm
Use it whenYou deploy to serverless or edge functions and want queries that read like SQL with full types.
Trade-offCloser to SQL means you need to know SQL, and there are fewer guides and integrations than for Prisma.
llms.txtCLIUsed by EmailCatcher, Flows, Penify, Rybbit, Sonofa and 5 more · in 136 open-source projects.
Drizzle ORM challenges MongoDB's schema-less claim. Schemas are beneficial, provided there's an effective solution for schema delta generation and migration scripts. Drizzle ORM did it.
SQLAlchemylibrary · open source · free tierPython backends (FastAPI, Flask, scripts) that want an ORM or a SQL toolkit over any relational database.185 open source94.3M/wk
Use it whenYour backend is Python and not Django, which ships its own ORM.
Trade-offA large API with two styles (ORM and Core); migrations come from a separate tool, Alembic.
No maker's product we track shows it for this yet · in 185 open-source projects.
Kyselylibrary · open source · free tierA type-safe SQL query builder for TypeScript, with no schema file or code generation step of its own.39 open source13.8M/wk3.9× vs npm
Use it whenYou like writing SQL and want it typed, without an ORM's model layer.
Trade-offA query builder rather than a full ORM — migrations are basic and relations are joins you write.
llms.txtNo maker's product we track shows it for this yet · in 39 open-source projects.
Who switches to what
Public pull requests on GitHub since Oct 2024 whose title says "X to Y" — real code changes, by developers in general rather than makers only. Pick a flow to see its pull requests.
- feat(db): migrate ORM from Prisma 7 to Drizzle (zero DDL, behavior parity)laststance/corelive · 2026-09-29
- Migrate from Prisma to Drizzle for schema-per-tenant supportadeel-boson/UPresent · 2026-09-27
- Refactor/prisma to drizzleAmruthaarunachalam/next.js-backend · 2026-09-24
- test(e2e): benchmark and verify the Prisma to Drizzle migration (ENG-2137)Shamiri-Institute/digitalhub · 2026-09-22
- refactor(db): migrate from prisma to drizzle ormcs-esmaeili/lio_back · 2026-09-20
- Migrate jetstream.spec.ts's direct Board query from Prisma to Drizzlemkizka/linkat · 2026-09-19
- feat: migrate from Prisma to Drizzle v1 RC3exKAZUu-Research/trace-dojo · 2026-09-11
- Pr2/prisma to drizzle api jobsusemarble/marble · 2026-09-11
- feat(error-tracker)!: port @context-kit/error-tracker from Prisma to Drizzlequeso/context-kit-packages · 2026-09-11
- switch from the prisma to the drizzle ORMvirtualabishek/24hoursnews · 2026-09-10
- feat(db): migrate from Drizzle to Prisma and TypedSQLlaoz40/Horus · 2026-09-17
- Migrate auth (users table) from Drizzle to Prisma, remove Drizzlemouhamed2213/3btrading-erp-crm · 2026-09-08
- Migrate database layer from Drizzle to Prismadinokage/shotgun-mock · 2026-09-07
- Migrated from Drizzle to PrismaAnish-75/backend-exp · 2026-08-20
- chore(backend): migrate drizzle to prisma orm 7jushoo/trade-blotter · 2026-08-20
- feat(drizzle): example application, and two fixes to the prisma example it inherited fromcerbos/query-plan-adapters · 2026-08-10
- ORM migration from Drizzle to Prismaungdev/Integration · 2026-07-06
- refactor: migrate database ORM from Drizzle to Prismajohn-data-chen/sveltekit-starter-kit · 2026-06-12
- refactor(db): migrate ORM from Drizzle to Prismainnovationtreehouse/apps.arbor · 2026-06-09
- feat: Migrate from Drizzle ORM to Prisma 7fatkquladhim/ClassMe · 2026-02-05
- refactor(db): Phase 3 — migrate Prisma master-table repositories to Kysely (#62)flipslidersand-labs/loopnest-core · 2026-09-06
- fix: three bugs found while scoping the Prisma to Kysely migrationcivitai/civitai · 2026-08-09
- Migrate excavator-web from Prisma to Kysely to fix runaway memory usageloathers/excavator · 2026-07-24
- Migrate database layer from Prisma to Kyselyloathers/museum · 2026-05-10
- Migrate from Prisma to Kyselyloathers/greenbox · 2026-05-10
- Migrate from prisma to kysely because prisma has become annoyingloathers/oaf · 2026-02-13
- Migration from Prisma ORM to Kysely queries + update Zod from v3 to v4introbotai/linkedin-resolver · 2025-12-26
- feat: migrate from Prisma to Kysely for better performanceruidolp/wapp · 2025-11-06
- Migrate from prisma to kyselylpgera/cookbook · 2025-11-02
- feat: Switch from Prisma to Kysely for the meantimeredwoodjs/sdk · 2024-11-26
- refactor(api): switch from Kysely and dbmate to Drizzle ORM and drizzle-kityutaasakura96/overload · 2026-09-25
- Add SQL to Kysely generator and upgrade SQL to Drizzle tooldaxt61/multi-tool-site · 2026-09-23
- refactor(db): migrate from kysely to drizzleblinkdisk/blinkdisk · 2026-06-28
- Migrate Playwright tests from Kysely to Drizzle ORM and add CI workflowncrmro/website · 2025-12-24
- Migrate from Kysely to Drizzle ORMncrmro/website · 2025-11-20
- Migrated from Kysely to Drizzle and implemented a Demo modeRaulRohjans/spenser · 2025-08-18
- migration: drizzle to kysely, slim down to data APIdvgamerr-app/aide-collector · 2026-06-17
- refactor(db): switch from drizzle to kysely + atlasponti-studios/hominem · 2026-03-07
- feat: migrate hono example from Drizzle to KyselyAndrey-jpeg/goodie · 2026-03-01
- feat: migrate hono example and docs from Drizzle to KyselyAndrey-jpeg/goodie · 2026-03-01
- refactor!: change drizzle to kysely for internal querieswannabespace/conar · 2025-11-14
Before you choose
Keep every schema change in migrations checked into the repo, and run them in CI or on deploy — never by hand in production. If you're on a backend platform, start with its client and add an ORM only when you outgrow it.
- Editing tables in the production console instead of writing a migration, so the next deploy's migration fails or silently drops the change.
- Loading related rows one query at a time in a loop, which feels fine on ten rows and times out on a thousand.
- Adding an ORM on top of a backend platform's client out of habit, then fighting two sources of truth for types and access rules.
Other options
Real choices most makers here won't need to weigh.
Decided alongside
What the 41 makers' products here chose for their other decisions.