Database Drivers
Drizzle ORM supports a wide range of database drivers across PostgreSQL, MySQL, and SQLite. Each driver is optimized for specific use cases and deployment environments.Driver Categories
PostgreSQL Drivers
Drizzle supports multiple PostgreSQL drivers, each optimized for different environments:node-postgres (pg)
Traditional Node.js driver with connection pooling
postgres.js
Modern, fast PostgreSQL driver for Node.js
Neon Serverless
WebSocket-based driver for Neon serverless databases
Neon HTTP
HTTP-based driver for edge environments
Vercel Postgres
Optimized driver for Vercel deployments
MySQL Drivers
MySQL and MySQL-compatible database drivers:mysql2
Fast MySQL driver for Node.js with prepared statements
PlanetScale
Serverless driver for PlanetScale databases
SQLite Drivers
SQLite drivers for various JavaScript runtimes:better-sqlite3
Synchronous SQLite driver for Node.js
libSQL
Driver for Turso and local SQLite databases
Cloudflare D1
SQLite driver for Cloudflare Workers
Common Configuration Options
All Drizzle drivers support a consistent configuration API:Schema
Pass your schema to enable relational queries:Logger
Enable query logging for debugging:Casing
Automatically convert between database and JavaScript naming conventions:Cache
Enable query result caching:Connection Methods
Drizzle supports multiple ways to initialize database connections:Method 1: Pass existing client
Method 2: Connection string
Method 3: Configuration object
Environment-Specific Recommendations
Serverless (Edge)
- PostgreSQL: Neon HTTP, Vercel Postgres
- MySQL: PlanetScale Serverless
- SQLite: Cloudflare D1, Turso (libSQL)
Traditional Node.js
- PostgreSQL: node-postgres, postgres.js
- MySQL: mysql2
- SQLite: better-sqlite3
Long-Running Servers
- PostgreSQL: node-postgres with connection pooling
- MySQL: mysql2 with connection pooling
- SQLite: better-sqlite3
Next Steps
PostgreSQL
Learn about PostgreSQL drivers
MySQL
Learn about MySQL drivers
SQLite
Learn about SQLite drivers