Search Docs…

Search Docs…

Search Docs…

CI/CD Database Seeding

CI/CD Database Seeding

Modern development teams spend up to 40% of their testing time managing test data. Seedfast eliminates this bottleneck by integrating intelligent database seeding directly into your CI/CD pipelines.

The test data problem

Most teams rely on one of these approaches — and each has serious drawbacks:

Static SQL dumps — Files drift from production schemas, contain stale relationships, and require constant maintenance.

Custom seeding scripts — Become unmaintainable spaghetti code that breaks with every schema change.

Shared test databases — Create race conditions, test pollution, and "works on my machine" syndrome.

What Seedfast does differently

Seedfast analyzes your database schema, generates contextually appropriate data using AI, and populates tables while respecting all constraints and relationships.

Key benefits:

Automation — No manual intervention in CI/CD workflows
Referential integrity — No foreign key violations
Realistic patterns — Data that exercises real application logic
Scoped control — Seed only what you need

Natural language scope

Unlike traditional tools that require complex configuration files, Seedfast uses plain English to define what to seed:

# Seed by schema
seedfast seed --scope "HR schema: employees, departments, payroll"

# Seed by use case
seedfast seed --scope "Customers and orders for checkout flow testing"

# Seed with specificity
seedfast seed --scope "Single user with 3 pending orders"

The AI interprets your instructions and determines the optimal seeding strategy — no configuration files, no table mappings, no row count specifications.

Secure authentication

Seedfast implements a multi-layer security model for CI/CD:

API Key Authentication: Long-lived keys stored as CI/CD secrets.

export SEEDFAST_API_KEY="sfk_live_abc123..."

JWT Session Tokens: The CLI exchanges the API key for a short-lived JWT (30-minute TTL) before communicating with the seeding service. This ensures:

• Raw API keys never transit to backend services
• Compromised tokens expire quickly
• Revocation takes effect immediately

Output modes

JSON mode — Machine-readable for scripts:

{
  "success": true,
  "elapsed_seconds": 12.5,
  "tables": { "total": 8, "succeeded": 8 },
  "rows": 2500
}

Plain mode — CI log-friendly:

[2025-01-12T10:15:32Z] INFO: Seeding started
[2025-01-12T10:15:45Z] INFO: Completed users (500 rows, 3.2s)
[2025-01-12T10:15:58Z] INFO: Seeding completed: 8 tables, 2500 rows
GitHub Actions integration
name: E2E Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:15
        env:
          POSTGRES_PASSWORD: testpass
        ports:
          - 5432:5432
    steps:
      - uses: actions/checkout@v4
      - run: npm run db:migrate
      - name: Seed test data
        run: npx seedfast seed --scope "Users and products for e-commerce tests"
        env:
          SEEDFAST_API_KEY: ${{ secrets.SEEDFAST_API_KEY }}
          DATABASE_URL: postgres://postgres:testpass@localhost:5432/test
      - run: npm run test:e2e
GitLab CI integration
test:
  stage: test
  services:
    - postgres:15
  variables:
    POSTGRES_PASSWORD: testpass
    DATABASE_URL: postgres://postgres:testpass@postgres:5432/test
  script:
    - npm run db:migrate
    - npx seedfast seed --scope "Full test dataset" --output plain
    - npm run test
Best practices

1. Scope precisely

Narrower scope means faster execution:

# Too broad
--scope "All tables"

# Better
--scope "Users and orders for checkout tests"

# Best
--scope "Single user with 3 pending orders for cart test"

2. Validate with JSON output

RESULT=$(seedfast seed --scope "..." --output json)

if [ "$(echo $RESULT | jq -r '.success')" != "true" ]; then
  echo "Seeding failed!"
  exit 1
fi

3. Always run migrations first

steps:
  - run: npm run db:migrate
  - run: seedfast seed --scope "..."

4. Use separate API keys per environment

Create distinct keys for dev, staging, and production. This enables granular access control and independent rotation schedules.

Credential management

Never hardcode credentials. Use your CI/CD platform's secret management:

# GitHub Actions
env:
  SEEDFAST_API_KEY: ${{ secrets.SEEDFAST_API_KEY }}
  DATABASE_URL: ${{ secrets.DATABASE_URL }}

# GitLab CI
variables:
  SEEDFAST_API_KEY: $SEEDFAST_API_KEY
API key rotation

Rotate API keys regularly:

1. Generate new key in Seedfast dashboard
2. Update CI/CD secrets
3. Verify pipelines work with new key
4. Revoke old key

FAQ

Does Seedfast work with existing data?
Yes. Seedfast analyzes your existing schema and data patterns to generate compatible records that maintain referential integrity.

How long does seeding take?
Typical runs complete in 10-60 seconds. Use precise scoping to minimize duration.

What databases are supported?
PostgreSQL, MySQL, and SQL Server. Additional databases are on the roadmap.

Get started

Integrating Seedfast into your CI/CD pipeline takes minutes, not days. The benefits — consistent test data, faster pipelines, and eliminated manual work — compound with every build.