Skip to content

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

  1. Drizzle ORM12 of 1867%
  2. Kysely1 of 186%
  3. 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>
12 runs
  1. 1SQLAlchemy50%6
  2. 2Drizzle ORM33%4
  3. 3Hand-written SQLNo tool8%1
  4. 4Kysely8%1

Pick rates by model

Tool
SQLAlchemy
Drizzle ORM
Hand-written SQL
Kysely
Built its own
next.js gets resend, python gets raw smtp. 11 of 18 next.js runs used resend, 17 of 18 python runs used raw smtp

get told when the ORM pick moves

weekly at most. free.

read issue 2archive

Prompts and what each one got 3
  1. 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
  2. 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
  3. 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

loading 36 runs

every ORM tool we check for

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