Skip to content

Context-aware AI-powered database seeder for generating realistic test data.

Notifications You must be signed in to change notification settings

db-toolkit/dbseed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBSEED

Context-aware AI-powered database seeder for generating realistic test data.

Features

  • 🎯 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

Installation

curl -fsSL https://raw.githubusercontent.com/db-toolkit/dbseed/main/install.sh | bash

Or download the binary from releases.

Quick Start

Interactive Mode

dbseed

Follow the prompts to:

  1. Enter database connection string
  2. Select tables to seed
  3. Choose number of rows
  4. Select output method (file or database)

Generate Command

# 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

Introspect Schema

# 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

Options

Generate Command

  • -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)

Introspect Command

  • -c, --connection <string> - Database connection string (required)
  • -t, --tables <tables...> - Specific tables to introspect

Supported Data Types

  • Strings, Text, Email, URL, Phone
  • Integers, BigInt, Decimal, Float
  • Boolean, UUID, JSON/JSONB
  • Date, DateTime, Timestamp, Time
  • Arrays, Binary/Blob
  • Foreign Keys

Column Name Recognition

DBSEED intelligently generates data based on column names:

  • email → realistic email addresses
  • phone, mobile → phone numbers
  • first_name, last_name → person names
  • company → company names
  • address, city, country → location data
  • price, amount → currency values
  • created_at, updated_at → timestamps
  • And many more...

Development

# Install dependencies
bun install

# Run in dev mode
bun run dev

# Build binary
bun run build

Requirements

  • Bun runtime (for development only)

License

MIT

Contributing

Contributions welcome! Please open an issue or PR.

About

Context-aware AI-powered database seeder for generating realistic test data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published