Drizzle Orm D1
Type-safe Drizzle ORM setup for Cloudflare D1 covering schemas, migrations, queries, and batch transactions.
- CCM score
- 52 of 100
- skills.sh installs
- 443
- GitHub stars
- 257
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers D1 schema definition, relations, prepared statements, Drizzle Kit migrations, and the D1 batch API
- Includes
drizzle.config.tssetup, Wrangler migration commands, and templates for CRUD, joins, and transactions - Enforces
db.batch()for transactions because D1 rejects SQLBEGIN TRANSACTIONstatements - Designed for Workers projects that need typed SQL queries and a migration flow against remote D1 databases
Install
$ npx -y skills add secondsky/claude-skills --skill drizzle-orm-d1 -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Drizzle ORM for Cloudflare D1
Status: Production Ready ✅ Last Updated: 2025-12-14 Latest Version: drizzle-orm@0.45.2, drizzle-kit@0.31.10 Dependencies: cloudflare-d1, cloudflare-worker-base
Quick Start (10 Minutes)
1. Install Drizzle
bun add drizzle-orm drizzle-kit
2. Configure Drizzle Kit
Create drizzle.config.ts:
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
schema: './src/db/schema.ts',
out: './migrations',
dialect: 'sqlite', // MANDATORY since drizzle-kit 0.21 (D1 = sqlite)
driver: 'd1-http', // D1 HTTP driver for remote migrations/Studio
dbCredentials: { // MANDATORY: drizzle-kit 0.30+ tightened zod validation
accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,
databaseId: process.env.CLOUDFLARE_DATABASE_ID!,
token: process.env.CLOUDFLARE_D1_TOKEN!,
},
});
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Databases, Backend & APIs
- First seen
- Jun 3, 2026
Questions
What is the drizzle-orm-d1 skill for?
The drizzle-orm-d1 skill gives Claude Code a type-safe ORM workflow for Cloudflare D1 databases using Drizzle. It covers building D1 schemas, writing type-safe queries, managing migrations with Drizzle Kit, defining table relations, and using the D1 batch API. It also helps with D1_ERROR, transaction errors and foreign key constraint failures.
How do I install the drizzle-orm-d1 skill?
Run npx -y skills add secondsky/claude-skills --skill drizzle-orm-d1 -y in your project to install it. Once installed, the agent can write D1 schemas, generate migrations and run type-safe queries against your Cloudflare D1 database.
How does drizzle-orm-d1 handle transactions on Cloudflare D1?
The skill tells the agent to use the D1 batch API, db.batch([...]), instead of SQL BEGIN TRANSACTION, because D1 rejects it. It also explains how to define cascading foreign keys so constraint failures are avoided. The skill sits in the Databases category on Claude Marketplaces.
More from secondsky/claude-skills
All 116- Api Pagination442
- Api Response Optimization442
- Api Filtering Sorting440
- Bun Drizzle Integration440
- Defense In Depth Validation439
- Session Management438
- Bun Runtime437
- Nuxt Production434
- Ultracite434
- Bun Docker433
- Bun Tanstack Start433
- Api Gateway Configuration430
- Nuxt Ui V4430
- Oauth Implementation430
- Bun Test Mocking429
- Health Check Endpoints429
- Bun Test Coverage426
- Mobile Offline Support425
- Nuxt Server425
- Api Changelog Versioning424
- Bun Cloudflare Workers424
- Bun Workers424
- Dependency Upgrade424
- Idempotency Handling424
Similar to Drizzle Orm D1
More Databasesd1-drizzle-schemajezweb/claude-skills1.7K installsGenerate Drizzle ORM schemas for Cloudflare D1 with D1-specific column patterns, migrations, and docs.
drizzle-orm-patternsgiuseppe-trisciuoglio/developer-kit6K installsComprehensive Drizzle ORM guide for type-safe schemas, queries, relations, transactions, and migrations across five databases.
d1-migrationjezweb/claude-skills1.2K installsMigration workflow for Cloudflare D1 that generates with Drizzle and flags destructive SQL before applying.
bun-drizzle-integrationsecondsky/claude-skills440 installsType-safe Drizzle ORM setup and workflow for Bun's built-in SQLite driver, covering schemas through migrations.