What problem does it solve?
Provides clear, production-minded guidance for using Drizzle ORM with Bun's sqlite driver to design schemas, run reliable migrations, and write correct, type-safe queries so teams avoid data loss, type mismatches, and runtime surprises.
Core Features & Use Cases
- Schema Design & Types: Patterns for sqliteTable column types, timestamp modes, JSON/blob usage, indexes, and relations with TypeScript inference.
- Migrations & Workflow: Best practices for drizzle-kit generate/migrate workflows, reviewing generated SQL, and avoiding destructive DROP/RECREATE patterns in production.
- Queries & Transactions: Examples for select/insert/update/delete, joins, upserts, transactions, batching, prepared statements, and sync vs async APIs on bun:sqlite.
- Performance & Stability: PRAGMA tuning (WAL, synchronous, foreign_keys, busy_timeout), batching, and concurrency guidance to mitigate SQLITE_BUSY and other issues.
- Debugging & Known Gotchas: Logging, extracting SQL, common errors, and fixes for foreign keys, default functions, and type affinity surprises.
Quick Start
Initialize Drizzle with bun:sqlite, generate a migration from your schema file, review the SQL, and apply the migration to your database.