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-code

Installs into .claude/skills of the current project.

Files

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)

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
1bobmatnyc avatardigitalocean-networkingbobmatnyc/claude-mpm-skillsDigitalOcean networking services including VPC, firewalls, load balancers, reserved IPs, DNS, IPv6, and NAT gateway. Use when designing or securing network conn415skills.sh installs
2pproenca avatarexpo-react-native-coderpproenca/dot-skillsComprehensive Expo React Native feature development guide. This skill should be used when building mobile app screens, navigation, data fetching, authentication415skills.sh installs
3yfe404 avatarweb-scrapingyfe404/web-scraperThis skill activates for web scraping and Actor development. It proactively discovers APIs via traffic interception, recommends optimal strategy (traffic interc415skills.sh installs
4dotneet avatarcontext7dotneet/claude-code-marketplaceA skill for retrieving the latest library documentation using Context7. Use when the user asks about how to use a library, requests code examples, or instructs 412skills.sh installs
5secondsky avatarmobile-offline-supportsecondsky/claude-skillsOffline-first mobile apps with local storage, sync queues, conflict resolution. Use for offline functionality, data sync, connectivity handling, or encountering412skills.sh installs
6auth0 avatarauth0-flaskauth0/agent-skillsUse when adding session-based login, logout, or user profile to a Flask web application. Integrates auth0-server-python — use even if the user says "add login t411skills.sh installs