Best ORM for Next.js: what coding agents pick
Across 12 runs on Sonnet 5.5, SQLAlchemy leads with 50%, and 8% of runs used no third-party tool.
Last updated
36 scored runs3 modelslast run Oct 18, 2026$2.75 spent
On Next.js
18 runs on the Next.js starter, all models
- Drizzle ORM12 of 1867%
- Hand-written SQL4 of 1822%
- Kysely1 of 186%
- built its own, no named pattern1 of 186%
embed this chartfree, keep the link
<a href="https://whatagentspick.com/which-orm-do-coding-agents-pick/"><img src="https://whatagentspick.com/share/orm.png" alt="Which ORM do coding agents pick?" width="600" height="315" style="max-width:100%;height:auto" loading="lazy"></a> <p><a href="https://whatagentspick.com/which-orm-do-coding-agents-pick/">data: what agents pick</a></p>
- 1SQLAlchemy50%6
- 2Drizzle ORM33%4
- 3Hand-written SQLNo tool8%1
- 4Kysely8%1
Pick rates by model
| Tool | |||
|---|---|---|---|
| SQLAlchemy | |||
| Drizzle ORM | |||
| Hand-written SQL | |||
| Kysely | |||
| Built its own |
Prompts and what each one got 3
- orm-p1
Add a data access layer for users and posts. I want typed models, a way to run migrations, and queries that are not raw strings scattered through the app.
- SQLAlchemy6 of 12
- Hand-written SQL4 of 12
- Kysely1 of 12
- Drizzle ORM1 of 12
- orm-p2
Set up schema definitions for a users table and a posts table with a foreign key between them, plus migration tooling so I can evolve the schema later.
- Drizzle ORM6 of 12
- SQLAlchemy6 of 12
- orm-p3
I need models and queries for this project. Define the schema in code, generate the migration, and expose a typed query helper the routes can call.
- SQLAlchemy6 of 12
- Drizzle ORM5 of 12
- Built its own1 of 12
Starter repos 2
- Next.js + TypeScript
An App Router project with one page and one JSON route. Items live in a module-level array, so nothing survives a restart. No database, SDK, or platform config is present.
app/page.tsx, app/api/items/route.ts, app/items.ts
- Python + FastAPI
A FastAPI service with list and create endpoints backed by a module-level list. Dependencies are limited to FastAPI, Uvicorn, and Pydantic.
app/main.py, requirements.txt
How the runs went
- Scored runs
- 36 of 36
- Same pick on both repeats
- 15 of 18
- Stopped at the turn cap
- 5 of 36
- Detected from
- 31 dependencies, 4 imports
- Average run
- 46 s
- Spent
- $2.75
Every run
every ORM tool we check for
- SQLAlchemy18 of 36
- Drizzle ORM12 of 36
- Hand-written SQL4 of 36
- Kysely1 of 36
- Mongoose0 of 36
- Peewee0 of 36
- Prisma0 of 36
- Sequelize0 of 36
- SQLModel0 of 36
- Tortoise ORM0 of 36
- TypeORM0 of 36
head to head
ORM
Drizzle ORM vs Prisma
Drizzle ORM12 of 36
Prisma0 of 36
Drizzle ORM 12, Prisma 0, in 36 ORM runs. most runs went to neither: SQLAlchemy, 18 of 36.
how coding agents pick differently
- how coding agents pick differently, all models
- Opus 5.5 vs Sonnet 5.5same lead in 7 of 10
- Opus 5.5 vs Haiku 5.5same lead in 7 of 10
- Sonnet 5.5 vs Haiku 5.5same lead in 10 of 10
