D1 Database
Cloudflare D1 is a serverless SQLite database for Cloudflare Workers. Use when someone asks for "Cloudflare D1", "SQLite at the edge", "database for Workers", "serverless SQL" or "D1 migrations". Covers wrangler setup, SQL migrations, queries from a Worker, Drizzle ORM, read replication and limits.
Install
npx skills add TerminalSkills/skills --skill d1-databasegit clone --depth 1 https://github.com/TerminalSkills/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/d1-database ~/.claude/skills/d1-databasePersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Cloudflare D1
## Overview
D1 is Cloudflare's managed SQLite database. A Worker reaches it through a binding (`env.DB`), so there are no connection strings or pools. You pay per row read and written, and an idle database costs nothing beyond storage. Each database holds up to 10 GB on the Workers Paid plan (500 MB on Free), so the intended pattern is many smaller databases (per tenant or per user) rather than one huge one. Tested with Wrangler 4.152.0 and drizzle-orm 0.45.4.
## When to Use
- A Cloudflare Worker needs relational storage
- Read-heavy apps such as blogs, content sites and APIs
- Per-tenant or per-user databases
- Not for large blobs (use R2) or for very write-heavy workloads on a single database
## Instructions
### Setup
```bash
npm install --save-dev wrangler
npx wrangler d1 create blog-db # offers to add the binding to your Wrangler config
```
New projects use `wrangler.jsonc` (`wrangler.toml` still works). The binding looks like this; use the `database_id` printed by `d1 create`:
```jsonc
{
"name": "blog-api",
"main": "src/index.ts",
"compatibility_date": "2026-10-01",
"d1_databases": [
{ "binding": "DB", "database_name": "blog-db", "database_id": "<printed by wrangler d1 create>" }
]
}
```
`npx wrangler types` generates `worker-configuration.d.ts` with the `Env` type. Without it, declare `interface Env { DB: D1Database }` yourself.
### Schema and migrationsDetails
- Skill name
d1-database- Repository
- TerminalSkills/skills
- Path
skills/d1-database/SKILL.md- License
- Apache-2.0
- Repo updated
- 8 November 2026
FAQ
What does the D1 Database skill do?
Cloudflare D1 is a serverless SQLite database for Cloudflare Workers. Use when someone asks for "Cloudflare D1", "SQLite at the edge", "database for Workers", "serverless SQL" or "D1 migrations". Covers wrangler setup, SQL migrations, queries from a Worker, Drizzle ORM, read replication and limits.
How do I install the D1 Database skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add TerminalSkills/skills --skill d1-database. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is D1 Database popular?
It lives in TerminalSkills/skills, which has 213 GitHub stars and 34 forks.
Related skills
3dsmax Rendering
213TerminalSkills/skills
Scripts and configures production rendering in Autodesk 3ds Max with the V-Ray and Corona renderers: output size and files, render elements, denoising, light mix, batch and command-line rendering, and network rendering. Use when a user asks to set up a production render, render several cameras in one batch, render from the command line or on a render farm, add render passes for compositing, or cut render time for archviz and product shots.
3dsmax Scripting
213TerminalSkills/skills
Covers scripting Autodesk 3ds Max, the 3D modeling and rendering application, with MAXScript and Python (pymxs): scene manipulation, object creation, material assignment, camera and light setup, batch operations, and file I/O. Use when tasks involve automating repetitive 3ds Max workflows, batch processing scenes, running scripts headless with 3dsmaxbatch, creating custom tools, or scripting scene setup for archviz, product visualization, or VFX.
3proxy
213TerminalSkills/skills
3proxy is a small open-source proxy server that runs HTTP/HTTPS, SOCKS4/5, SNI and TCP/UDP port-mapping proxies from one config file. Use when a user asks to set up an HTTP or SOCKS5 proxy, add proxy users and passwords, write 3proxy access rules, chain or rotate upstream (parent) proxies, limit bandwidth, connections or monthly traffic per user, run 3proxy in Docker, or fix a 3proxy.cfg that will not start.
Data Migration
213TerminalSkills/skills
Plans and scripts data migrations between SQL databases: schema mapping, type conversion, batched and resumable loading, validation and cutover. Use when the user mentions "data migration," "database migration," "migrate from MySQL to PostgreSQL," "schema migration," "ETL pipeline," "data transfer," "database consolidation," "legacy migration," or "move data between databases." Covers schema analysis, mapping, transformation, batch processing, validation, and cutover planning. For query optimization during migration, see sql-optimizer.
Clickhouse
213TerminalSkills/skills
ClickHouse is a columnar OLAP database for real-time analytical queries over billions of rows. It speaks SQL, stores data in MergeTree tables, and rolls up data at insert time with materialized views. Use when the user wants to run ClickHouse in Docker, design MergeTree tables, load events or logs, write aggregation or retention queries, build rollups, or connect from Node.js. Trigger words: clickhouse, olap, mergetree, columnar database, analytics database.
Database Schema Designer
213TerminalSkills/skills
Designs database schemas with proper normalization, indexing, constraints, and tenant isolation patterns. Use when someone needs to create a new database schema, add multi-tenant support, design row-level security policies, or optimize table structures. Trigger words: database schema, table design, RLS, row-level security, foreign keys, indexes, migrations, ERD, data model, normalization.
Browse the most popular Claude skills, all databases skills, or write your own with the skills generator.