Supported databases
Overview
Prisma ORM supports PostgreSQL, MySQL, SQLite, MongoDB, SQL Server, CockroachDB, and serverless databases
Database versions
Self-hosted
| Database | Version |
|---|---|
| PostgreSQL | 9.6+ |
| MySQL | 5.6+ |
| MariaDB | 10.0+ |
| SQL Server | 2017+ |
| SQLite | All |
| MongoDB | 4.2+ |
| CockroachDB | 21.2.4+ |
Managed/Serverless
| Database | Notes |
|---|---|
| Neon | Serverless Postgres |
| Supabase | Postgres |
| PlanetScale | MySQL |
| Turso | libSQL (SQLite) |
| Cloudflare D1 (Preview) | SQLite |
| AWS Aurora | MySQL/Postgres |
| MongoDB Atlas | MongoDB |
Feature matrix
Constraints
| Feature | PostgreSQL | MySQL | SQLite | SQL Server | MongoDB |
|---|---|---|---|---|---|
| PRIMARY KEY | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| FOREIGN KEY | ✔️ | ✔️ | ✔️ | ✔️ | — |
| UNIQUE | ✔️ | ✔️ | ✔️ | ✔️* | ✔️ |
| NOT NULL | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| DEFAULT | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
*SQL Server has limitations with UNIQUE constraints
Data types
| Feature | PostgreSQL | MySQL | SQLite | SQL Server | MongoDB |
|---|---|---|---|---|---|
| Arrays | ✔️ | — | — | — | ✔️ |
| JSON | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Enums | ✔️ | ✔️ | ✔️ | — | ✔️ |
Database guides
- PostgreSQL — Self-hosted, Neon, Supabase, and CockroachDB
- MySQL/MariaDB — Self-hosted and PlanetScale
- SQLite — Local, Turso, and Cloudflare D1
- SQL Server
- MongoDB
Driver adapters
For custom database drivers, see Driver adapters.