Best database for Next.js: what coding agents pick
Across 12 runs on Sonnet 5.5, SQLite file leads with 75%, and 75% of runs used no third-party tool.
Last updated
36 scored runs3 modelslast run Oct 18, 2026$3.23 spent
On Next.js
18 runs on the Next.js starter, all models
- SQLite file11 of 1861%
- Self-hosted Postgres7 of 1839%
embed this chartfree, keep the link
<a href="https://whatagentspick.com/which-database-do-coding-agents-pick/"><img src="https://whatagentspick.com/share/database.png" alt="Which database do coding agents pick?" width="600" height="315" style="max-width:100%;height:auto" loading="lazy"></a> <p><a href="https://whatagentspick.com/which-database-do-coding-agents-pick/">data: what agents pick</a></p>
- 1SQLite fileNo tool75%9
- 2Self-hosted Postgres25%3
Pick rates by model
| Tool | |||
|---|---|---|---|
| SQLite file | |||
| Self-hosted Postgres | |||
| Built its own |
Prompts and what each one got 3
- database-p1
This app needs to store data that survives a restart. Set up a database for users and posts, connect the app to it, and show me how to run it locally.
- SQLite file8 of 12
- Self-hosted Postgres4 of 12
- database-p2
Add persistence to this project. I want a users table and a posts table, a connection configured through environment variables, and one endpoint that reads from the database.
- Self-hosted Postgres11 of 12
- SQLite file1 of 12
- database-p3
Right now everything is in memory and I lose it on reload. Move the data into a real database and wire up the connection.
- SQLite file11 of 12
- Self-hosted Postgres1 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
- 14 of 18
- Stopped at the turn cap
- 3 of 36
- Detected from
- 20 dependencies, 16 imports
- Average run
- 37 s
- Spent
- $3.23
Every run
every database tool we check for
- SQLite file20 of 36
- Self-hosted Postgres16 of 36
- Firebase0 of 36
- MongoDB0 of 36
- Neon0 of 36
- PlanetScale0 of 36
- Supabase0 of 36
- Turso / libSQL0 of 36
- Vercel Postgres0 of 36
head to head
database
Postgres vs SQLite
Self-hosted Postgres16 of 36
SQLite file20 of 36
SQLite 20, Postgres 16, in 36 database runs. Opus 5.5 went Postgres instead.
database
Supabase vs Neon
Supabase0 of 36
Neon0 of 36
neither got installed in 36 database runs. most common: SQLite file, 20 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
