explaingit

dream-horizon-org/datagen

Analysis updated 2026-05-18

59GoAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A Go command line tool that generates large amounts of realistic, internally consistent synthetic data from a small declarative model file.

Mindmap

mindmap
  root((datagen))
    What it does
      Generates synthetic data
      Keeps records internally consistent
    Tech stack
      Go language
      Declarative DSL
    Use cases
      Test data generation
      Linked model records
      Direct MySQL loading
    Audience
      Developers needing test data
    Output formats
      CSV
      JSON
      XML
      MySQL

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Generate a CSV file of realistic test data for a database table without writing a script by hand.

USE CASE 2

Create linked datasets where one generated record references another that already exists.

USE CASE 3

Load generated test data directly into a MySQL database for local development.

USE CASE 4

Filter which records get generated using tags on a shared model file.

What is it built with?

Go

How does it compare?

dream-horizon-org/datagenmitchellh/go-libuclwalkingddd/cpa-helper
Stars595663
LanguageGoGoGo
Last pushed2019-03-08
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity2/52/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Installation instructions are on a separate documentation site rather than in the README.

Free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.

In plain English

datagen is a command line tool, written in Go, for generating large amounts of synthetic data that still makes internal sense, such as a set of users where an order always references a user that actually exists in the same generated dataset. Instead of writing a script by hand, a user describes the shape of the data they want in a small declarative language that reads similarly to Go itself. A model file defines fields for a record, such as an id or a name, along with small generator functions that decide how each field's value is produced, for example an incrementing counter for the id or a call to a built in name generator for the name field. Once a model is written, running the datagenc command against it produces the requested number of records in the chosen output format. Supported formats include CSV, JSON, XML, or plain text sent to the terminal, and there is also direct integration for loading generated data straight into a MySQL database rather than exporting to a file first. The README highlights that the tool is built for speed by transpiling the declarative model into native Go code rather than interpreting it at generation time, which the project positions as its main performance advantage over similar tools. Other listed capabilities include defining relationships between models so one type of record can reference another that was generated earlier in the same run, and filtering which records get generated using tags. Installation instructions point to a separate documentation site rather than a single command in the README itself. The project includes a short demo video, is licensed under MIT, and welcomes contributions through a separate contributing guide.

Copy-paste prompts

Prompt 1
Help me write a datagen model file that generates 100 fake user records with an id and a name.
Prompt 2
Explain how datagen's self.datagen references work for linking two models together.
Prompt 3
Show me how to output generated data as JSON instead of CSV with datagen.
Prompt 4
Walk me through loading datagen output straight into a MySQL table.

Frequently asked questions

What is datagen?

A Go command line tool that generates large amounts of realistic, internally consistent synthetic data from a small declarative model file.

What language is datagen written in?

Mainly Go. The stack also includes Go.

What license does datagen use?

Free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.

How hard is datagen to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is datagen for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.