Updated
Ship and run

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.

For your framework or language:Next.js
Ask your AI about this, with this page as the source:ChatGPT ↗Claude ↗Perplexity ↗

Trends

Kysely gained the most ground in package downloads: 4× against the median npm package over a year.

Public counts each month: pull requests on GitHub, package downloads, stars, Product Hunt followers. They show direction, not market share.

ToolDownloadsStarsProduct Hunt
SQLAlchemy75.6M/wk★ 12.2k0 reviews
Drizzle ORM21.8M/wk+189% vs npm★ 36k74 followers
Kysely16.4M/wk4× vs npm★ 14.3k—
Prisma16.2M/wk−4% vs npm—871 followers
TypeORM4.9M/wk−46% vs npm★ 36.7k—
Sequelize2.7M/wk−64% vs npm★ 30.3k—

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.

What makers chose44 live products, each with a source. Not market share.

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 APIPrisma
  • You deploy to serverless or edge functions and want queries that read like SQL, fully typedDrizzle ORM
  • You already write SQL comfortably and only want types around it, no schema layerKysely
  • Your backend is Python and not DjangoSQLAlchemy

Compare the tools

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.

ToolBest for
Schema-first ORM1
Prismalibrary · open source · free tierA schema-first ORM with generated types and migrations.37+119 open source16.2M/wk−4% 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.txtMCPCLI

Used by Chat Thing, documenso, Firecoach AI, inbox-zero, Indie Hacker Stacks and 32 more · in 119 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!
Indie Hacker Stacks, the makerSep 2026 ↗
SQL-shaped ORM2
Drizzle ORMlibrary · open source · free tierA thin, SQL-like TypeScript ORM that runs well on serverless and edge runtimes.12+152 open source21.8M/wk+189% 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.txtCLI

Used by Flows, OpenWhispr, Rybbit, Sonofa, Vouch and 7 more · in 152 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.
Sonofa, the makerSep 2026 ↗
SQLAlchemylibrary · open source · free tierPython backends (FastAPI, Flask, scripts) that want an ORM or a SQL toolkit over any relational database.1+221 open source75.6M/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.

Used by Semgrep · in 221 open-source projects.

Query builder1
Kyselylibrary · open source · free tierA type-safe SQL query builder for TypeScript, with no schema file or code generation step of its own.43 open source16.4M/wk4× 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.txt

No maker's product we track shows it for this yet · in 43 open-source projects.

Popular comparisons:Drizzle ORMvsPrisma

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.

Prisma → Drizzle ORM: 140 pull requestsDrizzle ORM → Prisma: 27 pull requestsPrisma → Kysely: 10 pull requestsKysely → Drizzle ORM: 6 pull requestsDrizzle ORM → Kysely: 5 pull requestsPrisma 150Drizzle ORM 32Kysely 6Drizzle ORM 146Prisma 27Kysely 15Moving fromMoving to
Prisma → Drizzle ORM140 PRs · Compare →

What Hacker News says

Hacker News commenters choose Prisma most often for database access & ORMs, and like Kysely best (net praise +44%). Among products launched since 2024 that show their choice, 71% use Prisma.

ToolHN comments choosing itNet praise on HNMakers' launches since 2024
Prisma137+10%71% 27
SQLAlchemy97+9%0% 0
Drizzle ORM44+10%29% 11
Kysely33+44%0% 0
Sequelize100%0% 0
TypeORM7−20%0% 0

Comments January 2023 to August 2026 that name the tool in a sentence like "I use" or "we moved to", estimated from a sample Claude read; net praise is comments recommending it minus comments criticizing it, as a share of all comments about it. Makers: of 38 launches that show what they use here. HN commenters and makers are different crowds — where they agree and where they split.

Before you choose

How to approach it

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.

Common mistakes
  • 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 44 makers' products here chose for their other decisions.