drizzle-orm-sqlite

Design Drizzle ORM schemas, migrations, and queries for Bun SQLite.

59|14|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/vobase/vobase --skill drizzle-orm-sqlite
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-orm-sqlite
Source: https://github.com/vobase/vobase/tree/main/.agents/skills/drizzle-orm-sqlite
Command: npx skills add https://github.com/vobase/vobase --skill drizzle-orm-sqlite

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about drizzle-orm-sqlite

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Drizzle ORM with Bun SQLite?

To set up Drizzle ORM with Bun SQLite, initialize the drizzle-orm instance using the bun:sqlite driver, define your sqliteTable schemas, and generate migrations using the drizzle-kit tooling for type-safe query execution.

What is the best way to avoid destructive schema changes when running Drizzle migrations?

The best way to avoid destructive schema changes during Drizzle migrations is to use the drizzle-kit generate workflow, carefully review the generated SQL output, and actively avoid destructive DROP or RECREATE patterns in production environments.

Does Drizzle ORM support async and sync APIs for bun:sqlite?

Yes, Drizzle ORM supports both sync and async APIs for bun:sqlite, allowing you to execute selects, inserts, updates, deletes, joins, and transactions flexibly while maintaining type safety across your database operations.

How do I fix SQLITE_BUSY errors and tune performance in Bun SQLite?

To fix SQLITE_BUSY errors and tune performance in Bun SQLite, apply PRAGMA tuning settings such as WAL mode, synchronous, foreign_keys, and busy_timeout, alongside batching and concurrency guidance to mitigate locking issues.

What are common gotchas when defining sqliteTable schemas with Drizzle ORM?

Common gotchas when defining sqliteTable schemas with Drizzle ORM include unexpected type affinity behavior, issues with foreign keys, and default function misconfigurations, which require careful TypeScript inference and debugging to resolve.

Can I use prepared statements and transactions with Drizzle ORM in Bun?

Yes, you can use prepared statements and transactions with Drizzle ORM in Bun to execute batched selects, inserts, updates, and deletes efficiently while ensuring type-safe and reliable database query execution.