Skip to content
alinaqi avatar

Cloudflare D1

Cloudflare D1 SQLite database setup with Drizzle ORM, schema definitions, and version-controlled migrations for Workers.

CCM score
54 of 100
skills.sh installs
327
GitHub stars
712
last updated
Jun 3, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers project setup, D1 database creation, wrangler.toml configuration, and generating Worker environment types
  • Includes Drizzle schema definitions, drizzle.config.ts, a typed database client, and a Hono-based CRUD Worker example
  • Guides migration generation with drizzle-kit generate and applies them locally or remotely via wrangler d1 migrations apply
  • Designed for developers building serverless Workers applications that need SQLite storage with type-safe queries

Install

$ npx -y skills add alinaqi/maggy --skill cloudflare-d1 -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Cloudflare D1 Skill

Cloudflare D1 is a serverless SQLite database designed for Cloudflare Workers with global distribution and zero cold starts.

Sources: D1 Docs | Drizzle + D1 | Wrangler CLI


Core Principle

SQLite at the edge, migrations in version control, Drizzle for type safety.

D1 brings SQLite's simplicity to serverless. Design for horizontal scale (multiple small databases) rather than vertical (one large database). Use Drizzle ORM for type-safe queries and migrations.


D1 Stack

ComponentPurpose
D1Serverless SQLite database
WorkersEdge runtime for your application
WranglerCLI for development and deployment
Drizzle ORMType-safe ORM with migrations
Drizzle KitMigration tooling
HonoLightweight web framework (optional)

Project Setup

Create Worker Project

# Create new project
npm create cloudflare@latest my-app -- --template "worker-typescript"
cd my-app

Details

Repository
github.com/alinaqi/maggy
Categories
Databases, Backend & APIs
First seen
Jun 3, 2026

Questions

What does the cloudflare-d1 skill do?

The cloudflare-d1 skill covers Cloudflare D1, a serverless SQLite database for Cloudflare Workers. It sets up Drizzle ORM for type-safe queries and migrations, with wrangler commands for local and remote databases.

How do I install the cloudflare-d1 skill?

Run npx -y skills add alinaqi/maggy --skill cloudflare-d1 -y in your project. Once installed, the agent can help you create a D1 database, configure wrangler.toml and write Drizzle schemas and migrations.

What does the cloudflare-d1 skill need to work?

The skill assumes a Cloudflare Workers project using wrangler and Drizzle ORM. Drizzle Kit needs CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_DATABASE_ID and CLOUDFLARE_D1_TOKEN environment variables for remote migrations.

Which other database skills sit next to cloudflare-d1?

Cloudflare-d1 is in the Databases category alongside supabase-postgres-best-practices and several prisma skills. Where those target Postgres and Prisma, this skill focuses on SQLite at the edge with Workers.

More from alinaqi/maggy

All 54

Similar to Cloudflare D1

More Databases