Bulk-load millions of rows
Problem: writing tens of millions of INSERT statements and replaying
them is slow.
Solution:
# Auto-selects the fastest method for the dialectdbsprout generate --rows 10000000 --output-format direct \ --db postgresql://localhost/myapp
# Force a method: auto | copy | load_data | batchdbsprout generate --output-format direct \ --db mysql+pymysql://localhost/myapp --insert-method load_dataWhy it works: --output-format direct streams rows straight into the
target using PostgreSQL COPY or MySQL LOAD DATA (100K+ rows/sec) instead
of generating and replaying SQL text. Add --upsert for idempotent
insert-or-update loads.