● Guides

Output Formats

Select a format with --output-format / -f (default: sql).

File Formats

SQL INSERT (Default)

dbsprout generate --output-format sql

Standard INSERT INTO statements. Use --dialect to target a specific SQL dialect (postgresql default, mysql, sqlite, …). Files are numbered by insertion order (001_authors.sql, 002_books.sql, …) so they apply cleanly.

CSV

dbsprout generate --output-format csv

One CSV file per table, with headers.

JSON

dbsprout generate --output-format json

One file per table — a pretty-printed array of objects.

JSONL

dbsprout generate --output-format jsonl

One object per line — convenient for streaming and data pipelines.

Parquet

dbsprout generate --output-format parquet

Columnar format, ideal for analytics pipelines and data warehouses.

Direct Database Insertion

Write straight into a target database using native bulk-loading protocols:

# Auto-selects the fastest method for the dialect
dbsprout generate --output-format direct --db postgresql://localhost/myapp

# Force a method: auto | copy | load_data | batch
dbsprout generate --output-format direct --db mysql+pymysql://localhost/myapp --insert-method load_data

PostgreSQL COPY and MySQL LOAD DATA reach 100K+ rows/sec. The target URL can also come from the DBSPROUT_TARGET_DB environment variable.

UPSERT

--upsert emits idempotent insert-or-update statements — INSERT … ON CONFLICT (PostgreSQL) or INSERT … ON DUPLICATE KEY UPDATE (MySQL). It combines with sql or direct output:

dbsprout generate --upsert --output-format sql
dbsprout generate --upsert --output-format direct --db postgresql://localhost/myapp

Output Directory

Files are written to ./seeds/ by default. Customize with:

dbsprout generate --output-dir ./my-seeds