SQLite
SQLite is the most used database engine in the world, a small, fast, self-contained SQL database running on a single local file.
What create-faster adds
Beyond the official setup, we include:
Local file database, zero infrastructure:
- No Docker container, no database server to run
DATABASE_URLpoints to a local file (file:./db.sqlite), created automatically bydb:migrate*.sqlite,*.sqlite-shm, and*.sqlite-walare git-ignored
Environment Variables:
DATABASE_URL:file:./db.sqlite(thefile:prefix is required by libSQL for local files)
Database file location:
- Single repo: project root (
./db.sqlite) - Turborepo:
packages/db/db.sqlite
The Drizzle client anchors relative paths to the db package root, so db:push, db:seed, and app code always open the same file no matter which directory they run from.
Drizzle integration:
drizzle.config.tswithdialect: 'sqlite'- Schema uses
sqliteTablefromdrizzle-orm/sqlite-core(textids withcrypto.randomUUID(),integertimestamp/boolean modes) - Client uses
drizzle-orm/libsqlwith the@libsql/clientdriver — a runtime dependency that works on any JavaScript runtime - The same
@libsql/clientdriver powersdb:pushanddb:studio
Deployment constraint
SQLite reads and writes a file on disk, so it is rejected with every deployment that has no persistent writable disk:
--deployment cloudflare: Workers have no filesystem. Use Cloudflare D1, the same SQLite dialect as a managed binding.--deployment sstand--deployment terraform-aws: Lambda has no persistent writable disk, so a database file would not survive between invocations. Use PostgreSQL or MySQL.
Driver choice
The runtime driver is @libsql/client (via drizzle-orm/libsql):
- Runtime-agnostic — runs on Node and Bun alike, so the generated project works with any package manager (
npm,pnpm,bun). It ships prebuilt binaries, nothing to compile. - Same SQLite dialect as Cloudflare D1 — the schema (
sqliteTable) and drizzle-kit config carry over unchanged when targeting D1 later; only the driver binding changes - Turso upgrade path — libSQL connects to both local files and remote Turso databases, so moving to a hosted database later is just a
DATABASE_URLchange
ORM constraint
Only Drizzle is available with SQLite. --database sqlite --orm prisma is rejected, and the interactive ORM prompt only offers compatible options.
bunx create-faster myapp --app myapp:nextjs --database sqlite --orm drizzleWorkflow
bun run db:generate # writes the SQL migration from the schema
bun run db:migrate # creates db.sqlite and applies the migration
bun run db:seed # seeds sample data
bun run db:studio # inspect data
