db-seed

Generates idempotent database seed scripts with realistic sample data from Drizzle schemas or SQL migrations.

1|Updated Aug 18, 2026
One-click install
npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill db-seed-scsm-unrestrict
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-seed
Source: https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent/tree/main/frontend-engineer/skills/db-seed
Command: npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill db-seed-scsm-unrestrict

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Populating development, demo, or test databases with realistic sample data is tedious and error-prone: developers must respect foreign key ordering, handle platform limits like D1 batch constraints, and avoid generic placeholder data that fails to exercise real application behavior. ## Core Features & Use Cases - Schema-aware generation: Reads Drizzle schemas, SQL migrations, or Prisma files to build a dependency graph and insert parent tables before children. - Realistic domain data: Produces names, emails, dates, and prices matched to the application domain instead of "test123" placeholders, with optional deterministic seeded randomness. - Idempotent output: Emits TypeScript (Drizzle) or raw SQL seed files that are safe to re-run via delete-then-insert or upsert strategies, with D1-specific batching handled. - Use Case: You just defined a Drizzle schema for a blog with users, posts, and comments. Ask for a seed script and receive a ready-to-run scripts/seed.ts that inserts 20 users, 50 posts, and comments in correct foreign-key order, batched for D1 limits. ## Quick Start Ask the agent to generate a seed script for your database by pointing it at your Drizzle schema or SQL migrations and specifying the purpose (dev, demo, or testing) and row volume.

Frequently Asked Questions about db-seed

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a database seed script from a Drizzle schema?

Point the skill at your Drizzle schema files (such as src/db/schema.ts) and specify purpose and volume. It reads the tables, builds a foreign key dependency graph, and outputs a ready-to-run TypeScript seed file with realistic data inserted in the correct order.

How to seed a Cloudflare D1 database with sample data?

Generate either a TypeScript seed run with npx tsx or a raw SQL file executed via npx wrangler d1 execute. The generator batches inserts in chunks of 10 rows to respect D1 limits and keeps batch size times columns under the 100 bound-parameter cap.

Does the seed generator support Prisma or raw SQL schemas?

Yes. It scans for Drizzle schemas, SQL migration files, raw schema.sql files, and prisma/schema.prisma. It reads whichever source exists to infer tables, constraints, and relationships before generating seed data.

How do I make a database seed script idempotent?

Use delete-then-insert for dev and testing, or upsert with onConflictDoUpdate for demo environments where users may have added their own data. The generated scripts default to one of these two strategies so re-running never fails on unique constraints.

Why does my D1 seed insert fail with too many rows?

D1 limits inserts to roughly 10 rows per statement and 100 bound parameters total. Split large datasets into batches of 10 rows per INSERT, and reduce batch size further if tables have many columns.