Agent skill · software engineering · secondsky
cloudflare-d1
Cloudflare D1 serverless SQLite on edge. Use for databases, migrations, bindings, or encountering D1_ERROR, statement too long, too many requests queued errors.
Why this skill is useful
Provides specific commands and patterns for managing Cloudflare D1 databases that the AI wouldn't reliably generate on its own.
What it needs
Requires bun, wrangler installed locally. Requires cloudflare account access. About 8k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.
What this skill does
Cloudflare D1 Database Status: Production Ready ✅ Last Verified: 2025-01-15 Table of Contents 1. What Is D1? 2. Quick Start 3. Critical Rules 4. D1 API Methods 5. Top 5 Use Cases 6. Migrations Best Practices 7. Common Patterns 8. SQLite Type Affinity 9. Top 5 Errors Prevented --- What Is D1? Cloudflare D1 is serverless SQLite on the edge: SQL database without servers Global distribution Zero cold starts Standard SQLite syntax Read replication for global performance --- 🆕 New in 2025 D1 received major updates throughout 2025: Performance (January 2025) 40-60% latency reduction globally (P50 query times) Optimized SQLite engine for edge execution Reduced cold start impact for databases <100 MB Reliability (September 2025) Automatic query retries: Read queries retry up to 2x on transient failures Transparent to application code (logged in wrangler tail) Scalability (April 2025) Read Replication (Public Beta): Deploy read replicas globally Up to 2x read throughput for read-heavy workloads Sessions API for read-write separation Compliance (November 2025) Data Localization: Specify EU/US jurisdiction for GDPR/data sovereignty Configure via --jurisdiction flag or wrangler.jsonc ⚠️ Breaking Change (February 10, 2025) Free tier hard limits enforced: 10 DBs, 500 MB each, 50 queries/invocation Exceeding limits = 429 errors (previously warnings only) Action: Review usage with wrangler d1 list and upgrade if needed Full details: Load references/2025-features.md --- Quick Start (5 Minutes) 1. Create Database Save the databaseid from output! 2. Configure Binding Add to wrangler.jsonc: 3. Create Migration Edit migrations/0001createusers.sql: 4. Apply Migration 5. Query from Worker Load references/setup-guide.md for complete walkthrough. --- Critical Rules Always Do ✅ 1. Use prepared statements with .bind() (never string concatenation) 2. Create indexes for WHERE/JOIN/ORDER BY columns 3. Use migrations for schema changes (never manual SQL) 4. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills secondsky/cloudflare-d1