How sujanks/data-generator works
Data Generator is a Go command-line tool that turns YAML table manifests into synthetic records and writes them to a configured sink. The main workflow runs from the CLI through manifest parsing, dependency-aware record generation, rule evaluation, and sink insertion. The README also describes validation, rich built-in and Cassandra-specific types, and CSV output. Some of those capabilities are documented but not fully visible in the excerpts; the graph shows them without inferring unshown internal calls.
Main entry points: generate_data.go Generator · generate.go CLI · postgres_sink.go Postgres sink · sink.go Sink interface
Components 13
Command entry
- CLI
data-gen-app/generate.go - YAML manifest
data-gen-app/manifest/application.yaml
Generation core
- Generator
data-gen-app/pkg/generate_data.go - Schema model
data-gen-app/pkg/types/schema.go - Value generators
data-gen-app/pkg/types/schema.go - Rules engine
data-gen-app/pkg/generate_data.go - Constraints
data-gen-app/pkg/types/schema.go
Output sinks
- CSV sink
data-gen-app/pkg/sink/csv_sink.go - Sink interface
data-gen-app/pkg/sink/sink.go - Postgres sink
data-gen-app/pkg/sink/postgres_sink.go
Database
- Postgres database
- Application tables
db/schemas/application/application.sql
Other components
- Operator
Connections 13
- Operator → CLI: runs
README.md - CLI → YAML manifest: selects
data-gen-app/generate.go - CLI → Generator: invokes
data-gen-app/generate.go - CLI → Postgres sink: configures
data-gen-app/generate.go - Generator → Schema model: parses
data-gen-app/pkg/generate_data.go - Generator → Value generators: generates values
data-gen-app/pkg/generate_data.go - Generator → Rules engine: applies rules
data-gen-app/pkg/generate_data.go - Generator → Constraints: validates records
README.md - Generator → Sink interface: inserts records
data-gen-app/pkg/generate_data.go - CSV sink → Sink interface: implements
README.md - Postgres sink → Sink interface: implements
data-gen-app/pkg/sink/postgres_sink.go - Postgres sink → Postgres database: writes records
data-gen-app/pkg/sink/postgres_sink.go - Application tables → Postgres database: defines tables