drizzle-orm-d1
Installation
Summary
Type-safe D1 databases with Drizzle ORM, migrations, and batch API patterns for Cloudflare Workers.
- Includes schema definition, Drizzle Kit migrations, relations, and D1-specific batch API for transactions (D1 doesn't support SQL BEGIN)
- Prevents 18 documented errors including transaction failures, cascade data loss, 100-parameter limits, foreign key issues, and nested migration discovery
- Supports dynamic query building, upserts, logging, and Drizzle Studio for visual database browsing
- Critical D1 rules: use
db.batch()for transactions, test migrations locally first, useintegerwithmode: 'timestamp'for dates, chunk bulk inserts under 100 parameters
SKILL.md
Drizzle ORM for Cloudflare D1
Status: Production Ready ✅ Last Updated: 2026-02-03
Commands
| Command | Purpose |
|---|---|
/db-init |
Set up Drizzle ORM with D1 (schema, config, migrations) |
/migrate |
Generate and apply database migrations |
/seed |
Seed database with initial or test data |
| Latest Version: drizzle-orm@0.45.1, drizzle-kit@0.31.8, better-sqlite3@12.5.0 | |
| Dependencies: cloudflare-d1, cloudflare-worker-base |
Quick Start (5 Minutes)
Related skills
More from jezweb/claude-skills
tailwind-v4-shadcn
|
2.7Ktanstack-query
|
2.5Kshadcn-ui
Install and configure shadcn/ui components for React projects. Guides component selection, installation order, dependency management, customisation with semantic tokens, and common UI recipes (forms, data tables, navigation, modals). Use after tailwind-theme-builder has set up the theme infrastructure, when adding components, building forms, creating data tables, or setting up navigation.
2.5Ktailwind-theme-builder
>
2.2Kfastapi
|
2.0Kcolor-palette
>
1.9K