Context-aware AI-powered database seeder for generating realistic test data.
- 🎯 Interactive Mode - Guided prompts for easy data generation
- 🔍 Schema Introspection - Automatically reads your database structure
- 🔗 Foreign Key Support - Generates data respecting relationships
- 🎲 Smart Data Generation - Context-aware fake data using Faker.js
- 💾 Flexible Output - SQL file or direct database insertion
- ⚡ Fast - Built with Bun and TypeScript
- 📦 Standalone Binary - No runtime dependencies
curl -fsSL https://raw.githubusercontent.com/db-toolkit/dbseed/main/install.sh | bashOr download the binary from releases.
dbseedFollow the prompts to:
- Enter database connection string
- Select tables to seed
- Choose number of rows
- Select output method (file or database)
# Generate 1000 rows and insert into database
dbseed generate -c "postgresql://user:pass@localhost:5432/db" -n 1000
# Generate SQL file
dbseed generate -c "postgresql://user:pass@localhost:5432/db" -n 500 -o seed.sql
# Seed specific tables
dbseed generate -c "postgresql://user:pass@localhost:5432/db" -t users posts -n 100# View all tables
dbseed introspect -c "postgresql://user:pass@localhost:5432/db"
# View specific tables
dbseed introspect -c "postgresql://user:pass@localhost:5432/db" -t users posts-c, --connection <string>- Database connection string (required)-t, --tables <tables...>- Specific tables to seed-n, --rows <number>- Number of rows per table (default: 100)-o, --output <file>- Output SQL file (omit for direct DB insert)--ai- Use AI for context-aware generation (coming soon)
-c, --connection <string>- Database connection string (required)-t, --tables <tables...>- Specific tables to introspect
- Strings, Text, Email, URL, Phone
- Integers, BigInt, Decimal, Float
- Boolean, UUID, JSON/JSONB
- Date, DateTime, Timestamp, Time
- Arrays, Binary/Blob
- Foreign Keys
DBSEED intelligently generates data based on column names:
email→ realistic email addressesphone,mobile→ phone numbersfirst_name,last_name→ person namescompany→ company namesaddress,city,country→ location dataprice,amount→ currency valuescreated_at,updated_at→ timestamps- And many more...
# Install dependencies
bun install
# Run in dev mode
bun run dev
# Build binary
bun run build- Bun runtime (for development only)
MIT
Contributions welcome! Please open an issue or PR.