import-d1-database
A robust way to sync production data into a local D1 development database.
Install
mkdir -p .claude/skills/import-d1-database && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10254" && unzip -o skill.zip -d .claude/skills/import-d1-database && rm skill.zipInstalls to .claude/skills/import-d1-database
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Import or refresh a Cloudflare D1 database locally from a remote export when direct SQL dump execution fails because of foreign key ordering, transaction limitations, or wrangler import quirks. Use this skill when syncing production D1 data into the local development database.Key capabilities
- →Refresh local D1 from remote
- →Handle foreign key ordering
- →Sync production data to local
- →Restore local database state
How it works
The script extracts INSERT statements from a remote export, reorders them to satisfy dependency constraints, and executes them against a fresh local state directory.
Inputs & outputs
When to use import-d1-database
- →Refresh local d1 data
- →Sync production to local
- →Restore database state
About import-d1-database
Automates the import process for D1 databases, handling foreign key ordering and transaction constraints that typically break raw SQL imports.
Import or refresh a Cloudflare D1 database locally from a remote export when direct SQL dump execution fails because of foreign key ordering, transaction limitations, or wrangler import quirks. Use this skill when syncing production D1 data into the local development database.
When not to use it
- →Schema design
- →Schema migrations
Prerequisites
Limitations
- →Requires manual restoration of players.currentRankingId
- →Does not support schema migrations
- →Requires stopping all local dev processes
How it compares
Unlike raw SQL imports that fail due to transaction or foreign key restrictions, this script uses a controlled, dependency-aware insertion order.
Compared to similar skills
import-d1-database side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| import-d1-database (this skill) | 0 | 4mo | Review | Intermediate |
| drizzle-orm | 32 | 3mo | No flags | Intermediate |
| event-store-design | 5 | 4mo | No flags | Advanced |
| backend-development | 17 | 6mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
drizzle-orm
EpicenterHQ
Drizzle ORM patterns for type branding and custom types. Use when working with Drizzle column definitions, branded types, or custom type conversions.
event-store-design
wshobson
Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.
backend-development
skillcreatorai
Backend API design, database architecture, microservices patterns, and test-driven development. Use for designing APIs, database schemas, or backend system architecture.
postgresql
sickn33
Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features
epic-database
epicweb-dev
Guide on Prisma, SQLite, and LiteFS for Epic Stack
sql-translation
tidyverse
Guide for adding SQL function translations to dbplyr backends. Use when implementing new database-specific R-to-SQL translations for functions like string manipulation, date/time, aggregates, or window functions.