datagenc - Compiler Binary
datagenc is the compiler binary that takes .dg model files as input, transpiles them to Go code, and generates data. Use this binary when you’re working directly with model source files during development and testing.
Overview
Section titled “Overview”When to use datagenc:
- You’re iterating on source 
.dgmodel files - You’re in development or testing phases
 - You need to validate new or modified models
 
What it does:
- Reads 
.dgmodel files from the specified path - Transpiles them to Go code
 - Builds a temporary executable binary
 - Generates data in the specified format
 
Commands
Section titled “Commands”datagenc gen - Generate Data to Files
Section titled “datagenc gen - Generate Data to Files”Generate data from model files and output to files or stdout.
Syntax
Section titled “Syntax”datagenc gen <path> [flags]Required Arguments
Section titled “Required Arguments”<path>- Path to a.dgmodel file or directory containing model files
Command Flags
Section titled “Command Flags”| Flag | Short | Description | Default | Example | 
|---|---|---|---|---|
--count | -n | Number of records to generate (overrides metadata) | Uses metadata count | -n 1000 | 
--seed | -s | Seed for deterministic random generation | none | -s 12345 | 
--tags | -t | Filter models by tags (must match ALL key-value pairs) | "" | -t "service=auth,team=platform" | 
--output | -o | Output directory or file path | ”.” | -o ./data | 
--format | -f | Output format: csv, json, xml, stdout | stdout | -f csv | 
--noexec | Transpile and build only; skip data generation | false | --noexec | 
Quick Examples
Section titled “Quick Examples”# Generate data for all models in current directorydatagenc gen .
# Generate data for a specific model filedatagenc gen user.dg
# Generate 1000 records and save as CSVdatagenc gen user.dg -n 1000 -f csv -o ./data
# Filter models by tags in a directorydatagenc gen ./models -t "service=auth,team=platform"
# Deterministic output with seeddatagenc gen user.dg -n 10 -s 12345
# Process all models in a specific directorydatagenc gen ./models/Output Formats
Section titled “Output Formats”csv- Comma-separated values with headersjson- JSON array of objectsxml- XML format with root elementstdout- Print to standard output (default)
Count Behavior
Section titled “Count Behavior”The --count flag controls how many records to generate:
Without --count flag
Section titled “Without --count flag”Uses the count specified in each model’s metadata section:
model User {  metadata {    count: 500  // Will generate 500 records  }  // ...}If no metadata count is specified, defaults to 1 record.
With --count flag
Section titled “With --count flag”Overrides all model counts with the specified value:
# Generate exactly 1000 records for each model, ignoring metadatadatagenc gen . -n 1000Tags Filtering
Section titled “Tags Filtering”Tags allow you to logically group models and generate only specific subsets:
Defining Tags
Section titled “Defining Tags”model User {  metadata {    tags: {      "service": "user-management",      "team": "platform",      "environment": "test"    }  }  // ...}Using Tags
Section titled “Using Tags”# Generate only models with specific servicedatagenc gen ./models -t "service=user-management"
# Generate models matching multiple criteria (AND logic)datagenc gen ./models -t "service=auth,environment=test"
# Generate models for specific teamdatagenc gen ./models -t "team=platform"Important: Models must match ALL provided tag key-value pairs to be selected.
File Selection
Section titled “File Selection”All Models in Directory
Section titled “All Models in Directory”# Process all model files in current directorydatagenc gen .
# Process all model files in specific directorydatagenc gen ./models/Specific Models
Section titled “Specific Models”# Process a specific model filedatagenc gen user.dg
# Process a specific model file with a full pathdatagenc gen ./models/user.dgUsing Wildcards
Section titled “Using Wildcards”Wildcards are not supported as multiple path inputs. Provide a single directory path (recommended) or a single file path.
datagenc execute - Load Data to Data Sinks
Section titled “datagenc execute - Load Data to Data Sinks”Transpile model files and load data directly into database sinks like MySQL.
Syntax
Section titled “Syntax”datagenc execute <path> --config <config_file> [flags]Required Arguments
Section titled “Required Arguments”<path>- Path to a.dgmodel file or directory containing model files--config- Path to configuration JSON file
Command Flags
Section titled “Command Flags”| Flag | Short | Description | Example | 
|---|---|---|---|
--config | -c | Path to configuration JSON file | -c config.json | 
--output | -o | Output directory for transpiled artifacts | -o ./out | 
--noexec | Transpile only; do not run data loading | --noexec | 
Configuration File
Section titled “Configuration File”The execute command requires a JSON configuration file:
{  "models": [    {      "model_name": "User",      "target_sinks": ["mysql_sink"],      "count": 1000    },    {      "model_name": "Order",      "target_sinks": ["mysql_sink"],      "count": 500    }  ],  "sinks": [    {      "sink_name": "mysql_sink",      "sink_type": "mysql",      "config": {        "host": "localhost",        "database": "testdb",        "port": "3306",        "user": "root",        "password": "password",        "batch_size": 1000,        "throttle_ms": 10      }    }  ]}Examples
Section titled “Examples”# Load data from models in a directorydatagenc execute ./models --config config.json
# Load data with custom output directorydatagenc execute ./models -c config.json -o ./output
# Transpile only, don't executedatagenc execute ./models -c config.json --noexecProcess Flow
Section titled “Process Flow”- Reads 
.dgfiles from the specified path - Transpiles 
.dgfiles to Go code - Builds executable binary
 - Generates data according to config
 - Loads data into specified sinks
 
Use Cases
Section titled “Use Cases”- Testing new models
 - Development environment setup
 - Model validation and debugging
 - Onboarding new data models
 - Local testing with databases
 
Getting Help
Section titled “Getting Help”# General helpdatagenc --help
# Command-specific helpdatagenc gen --helpdatagenc execute --help
# Version informationdatagenc --versionNext Steps
Section titled “Next Steps”- Once your models are finalized and you want to deploy to production, consider building an encoded binary. See the datagen reference for working with pre-compiled binaries.
 - For a detailed comparison between binaries, see datagenc vs datagen
 - For model syntax, see Data Model concepts
 - For examples, see the Examples section