
Cloudflare D1
This is your complete reference for Cloudflare's serverless SQLite on the edge. It covers the full D1 API (prepare, batch, exec), migration workflows with wrangler, and the 2025 updates like read replication, automatic query retries, and the breaking change to free tier limits that hit in February. The critical rules section alone will save you from the usual mistakes: SQL injection from string concatenation, missing indexes, ignoring SQLite's type affinity quirks. Built for production with real error handling patterns, query optimization techniques, and examples that show you how to actually structure Workers with D1 bindings. If you're running databases at the edge or hitting D1_ERROR and rate limit issues, load this first.
- skills.sh installs
- 416
- GitHub stars
- 248
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill cloudflare-d1 --agent claude-codeInstalls into .claude/skills of the current project.
Files
Cloudflare D1 Database
Status: Production Ready ✅ | Last Verified: 2025-01-15
Table of Contents
- What Is D1?
- Quick Start
- Critical Rules
- D1 API Methods
- Top 5 Use Cases
- Migrations Best Practices
- Common Patterns
- SQLite Type Affinity
- 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)
Sponsors
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Backend & APIs, Debugging, Cloud & Infrastructure, Databases
- First seen
- Jun 3, 2026
More from secondsky/claude-skills
All 146- Api Changelog Versioning415
- Dependency Upgrade415
- Idempotency Handling415
- Nuxt Server415
- Turborepo414
- Mobile Offline Support412
- Recommendation System412
- Api Versioning Strategy410
- Claude Code Bash Patterns408
- Claude Hook Writer408
- Logging Best Practices408
- Cloudflare Manager407
- Plan Interview406
- Ml Pipeline Automation402
- Nuxt Core401
- Nuxt Data400
- Microservices Patterns398
- Multi Ai Consultant397
- Graphql Implementation393
- Mcp Management393
- Model Deployment393
- Jest Generator391
- Cloudflare Agents389
- Cloudflare Mcp Server388