Platform notes
Driver support depends on both the ORM and the runtime you choose. ViteHub provides sensible defaults, but you should still install the matching driver or adapter package for the database you run in production.
Default drivers
ViteHub chooses a default driver when you do not set db.driver explicitly.
| ORM | Dialect | Default |
|---|---|---|
| Drizzle | sqlite | libsql |
| Drizzle | postgresql | postgres-js, or pglite when no URL is configured |
| Drizzle | mysql | mysql2 |
| Prisma | sqlite | better-sqlite3, or libsql for LibSQL URLs |
| Prisma | postgresql | pg |
| Prisma | mysql | mariadb |
Local development
SQLite file URLs default to .data/db/sqlite.db when you do not provide a custom URL. Embedded PostgreSQL with PGlite defaults to .data/db/pglite.
Cloudflare and bindings
Drizzle remains the Cloudflare-first path for this package version. It can wire D1 bindings for SQLite and Hyperdrive bindings for PostgreSQL or MySQL when you provide the matching binding metadata.
Driver and adapter packages
Install the package that matches the runtime you configure:
- Drizzle requires the matching driver package such as
@libsql/client,pg,mysql2, or@electric-sql/pglite. - Prisma requires the matching adapter package such as
@prisma/adapter-pg,@prisma/adapter-better-sqlite3,@prisma/adapter-libsql, or@prisma/adapter-mariadb.
Changing db.driver without installing the matching package will leave the app configured for a runtime that cannot boot.