Skip to content

generate

generate creates relational synthetic SQL from a hand-authored YAML model, a model inferred from a SQL dump, or an inferred model plus explicit overrides. Its alias is gen.

Terminal window
sql-splitter generate [OPTIONS] [INPUT]

Provide a source dump, a complete --config model, or both. An overrides document requires a source dump because it patches the inferred base model.

Generate directly from a dump:

Terminal window
sql-splitter generate production.sql -o synthetic.sql

Generate repeatable fixtures from a reviewed model:

Terminal window
sql-splitter generate --config model.yaml --seed 42 -o synthetic.sql

Infer and save an editable model without generating SQL:

Terminal window
sql-splitter generate production.sql --emit-config model.yaml

Apply overrides while saving the resolved model and generated SQL:

Terminal window
sql-splitter generate production.sql \
--config overrides.yaml \
--emit-config resolved.yaml \
--scale 0.1 \
-o synthetic.sql
Terminal window
# Parse and compile a complete model; write nothing
sql-splitter generate --config model.yaml --check
# Resolve counts and dependencies without generating rows
sql-splitter generate --config model.yaml --dry-run
# Explain inferred column rules without printing observed values
sql-splitter generate production.sql --dry-run --explain
# Generate, audit exact checks, then publish atomically
sql-splitter generate --config model.yaml --verify -o synthetic.sql

--strict promotes warning-severity diagnostics to failures. Informational diagnostics and advisories remain non-fatal. --quiet suppresses ordinary human reporting, but safety advisories still reach stderr.

Input and modelMeaningDefault
[INPUT]Source SQL dump to profilenone
-c, --config <PATH>Complete model or overrides YAMLnone
--emit-config <PATH>Write the resolved complete modelnone
-o, --output <PATH>Generated SQL; - means stdoutstdout
--profile-depth <MODE>Profiling depth: basic or fullbasic
--profile-sample <COUNT>Retained profiling sample capacity1000
--input-dialect <DIALECT>Force the source parsing dialectauto-detect
RenderingMeaningDefault
--dialect <DIALECT>Output SQL dialectmodel, source, then MySQL
--schema-onlyEmit DDL onlyfalse
--data-onlyEmit row data onlyfalse
--batch-size <COUNT>Rows per INSERT or COPY batch (1–1,000,000)1000
--no-copyUse PostgreSQL INSERT instead of COPYfalse
--mssql-production-styleAdd production-style MSSQL DDL conventionsfalse
--mssql-go <COUNT>Emit GO every N MSSQL insert batchesevery batch
--compress <FORMAT>Reserved; currently unavailablenone
Volume and selectionMeaningDefault
--scale <FACTOR>Multiply every resolved row countnone
--rows <COUNT>Set absolute root-table countsnone
--table-rows <TABLE=COUNT>Per-table absolute count; repeatablenone
--table-scale <TABLE=FACTOR>Per-table scale; repeatablenone
--max-rows <COUNT>Cap every table after other count controlsnone
--tables <GLOBS>Include matching tables and required dependenciesall
--exclude <GLOBS>Exclude matching tablesnone
RandomnessMeaningDefault
--seed <U64>Stable root seedmodel or fresh entropy
--randomizeIgnore configured seed; use a new onefalse
Preflight and reportingMeaningDefault
--checkCompile a complete model onlyfalse
--dry-runCompile and report resolved countsfalse
--verifyGenerate, audit, and publish atomicallyfalse
--explainInclude inference decisionsfalse
--strictFail on warning-severity diagnosticsfalse
--jsonPrint a machine-readable report on stdoutfalse
--quietSuppress ordinary human reportingfalse
--progressAccepted but not wired to generationfalse
  • --check, --dry-run, and --verify are mutually exclusive.
  • --schema-only and --data-only are mutually exclusive.
  • --seed and --randomize are mutually exclusive.
  • --scale and --rows are mutually exclusive.
  • A table cannot receive both --table-rows and --table-scale.
  • --json, --output -, and --emit-config - each own stdout; select only one.
  • --json in generate mode writes only the report to stdout, so it requires -o <path> for the generated SQL (or use --check/--dry-run for a report-only run).
  • --check requires a complete model and cannot profile [INPUT].
  • --verify requires a real output path and cannot use compression.
  • MSSQL-specific flags require an explicit --dialect mssql.
TopicReference
YAML model languageModel reference
Column value producersGenerator reference
Post-generation transformsModifiers
Coordinated invariantsPlanners
Dump profiling and choicesProfiling and inference
Safety and exact checksPrivacy and verification
Stable GEN-* codesDiagnostics
Embedding in RustRust API
CodeMeaning
0Generation or the requested preflight mode succeeded
1Model, warning-under-strict, runtime, I/O, or verification failure
2Invalid CLI usage or conflicting flags