Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ellomas.com/llms.txt

Use this file to discover all available pages before exploring further.

Use Cases

Seedling fits into several key workflows — from CI pipelines to local development.

CI Pipeline Data Seeding

The most common use case: generate fresh test data in CI before running your test suite.
# .github/workflows/test.yml
jobs:
  test:
    services:
      postgres:
        image: postgres:16
        env:
          POSTGRES_DB: testdb
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: "1.25"
      - run: go install github.com/tomiwa-a/seedling/cmd/seedling@latest
      - run: seedling generate --db postgres://postgres@localhost:5432/testdb
      - run: go test ./...
Benefits: No stale snapshots, no manual SQL files, every CI run gets fresh referentially-valid data.

Integration Testing

Seed directly into your test database with deterministic seeds for reproducible tests:
func TestUserWorkflow(t *testing.T) {
    // Seed with deterministic data
    exec.Command("seedling", "generate",
        "--count", "100",
        "--seed", "42",
        "--db", "postgres://localhost:5432/testdb",
    ).Run()

    // Your test assertions
    users := fetchUsers()
    assert.Len(t, users, 100)
}
Use --seed 42 for reproducible test data — the same seed produces the same rows every time, making tests predictable and debug-friendly.

Staging Environment Refresh

Quickly populate a staging environment with realistic data:
# Truncate and regenerate
seedling generate \
  --count 500000 \
  --db postgres://staging:password@staging-host:5432/mydb \
  --truncate \
  --verbose

Local Development

Generate a small dataset for local development without needing production data:
# Small, fast dataset for dev work
seedling generate \
  --count 50 \
  --seed 1 \
  --output seed.sql

psql -d localdb -f seed.sql

Load Testing

Scale up to production-level volumes for performance testing:
# 10 million rows via COPY protocol for max throughput
seedling generate \
  --count 10000000 \
  --db postgres://localhost:5432/loadtest \
  --copy \
  --batch-size 5000

Schema Migration Testing

After running migrations, regenerate data to verify the new schema works:
# Run migration
migrate -database $DATABASE_URL -path migrations up

# Regenerate data against migrated schema
seedling introspect --db $DATABASE_URL --output schema.yaml
seedling generate --count 1000 --db $DATABASE_URL

Data Analysis & ML

Generate CSV or JSONL datasets for analytics workflows:
# CSV for spreadsheet analysis
seedling generate \
  --count 10000 \
  --output data/ \
  --format csv

# JSONL for event streams
seedling generate \
  --count 50000 \
  --output events.jsonl \
  --format jsonl