Configuring Database Providers
1. Using PostgreSQL Provider
Option Description
provider = "postgresql"Driver name
schemas = ["public","auth"]Multi-schema (preview)
?connection_limit=10Pool size
?pgbouncer=truePgBouncer compatibility
?sslmode=requireEnforce SSL
2. Configuring MySQL Provider
Option Description
provider = "mysql"MySQL/MariaDB
?sslaccept=strictValidate SSL cert
?connect_timeout=10Timeout (seconds)
?socket=/tmp/mysql.sockUnix socket connection
3. Setting Up SQLite Database
Feature Notes
URL file:./dev.db (relative to schema)
Supported types No Decimal, no enums, limited JSON
Concurrency Single writer; use WAL mode
Use case Development, tests, embedded apps
4. Using SQL Server Provider
Option Value
provider"sqlserver"
URL prefix sqlserver://
Encryption encrypt=true;trustServerCertificate=true
Schema schema=dbo
5. Configuring MongoDB Provider
Concept Mapping
Provider provider = "mongodb"
Primary key id String @id @default(auto()) @map("_id") @db.ObjectId
Relations Embedded or referenced via ObjectId arrays
Migrations Not supported; use db push
6. Setting Up CockroachDB
Feature Notes
Provider "cockroachdb"
ID type @default(sequence()) for unique IDs
URL postgresql://USER@HOST:26257/DB?sslmode=verify-full
7. Configuring Connection URLs
Parameter Purpose
connection_limitMax pool connections
pool_timeoutWait time (sec) for a connection
connect_timeoutTCP connect timeout
socket_timeoutQuery socket timeout
statement_cache_sizePrepared-statement cache
8. Using SSL Connections
Param PG / MySQL
sslmodedisable | prefer | require | verify-ca | verify-full
sslcertClient cert path
sslkeyClient key path
sslrootcertCA bundle path
9. Connecting to Cloud Databases
Provider Notes
Neon Use @neondatabase/serverless driver adapter
Supabase Use pooler URL + ?pgbouncer=true&connection_limit=1
AWS RDS Standard PG URL + SSL CA bundle
Railway / Render Provided DATABASE_URL works directly
10. Using PlanetScale
Setting Value
Provider "mysql"
Referential integrity relationMode = "prisma" (no FK constraints)
Driver adapter @prisma/adapter-planetscale
Migrations Use db push + PlanetScale deploy requests
Warning: PlanetScale and Vitess do not support foreign key constraints. Set relationMode = "prisma" so Prisma emulates referential integrity in application code.