Getting Started
Get up and running with datagen in just a few minutes. This guide will walk you through installing datagen and generating your first dataset.
Prerequisites
Section titled “Prerequisites”Installation
Section titled “Installation”Option 1: Install via Go
Section titled “Option 1: Install via Go”Check your $PATH, and choose a directory you would like to place the datagenc compiler in.
echo $PATH/Users/username/go/bin:/opt/homebrew/bin:/opt/homebrew/sbinSay, you wish to place the binary in /opt/homebrew/bin;
export GOBIN=/opt/homebrew/bingo install github.com/dream-horizon-org/datagen/cmd/datagenc@0.1.0Verify installation
Section titled “Verify installation”datagenc --helpOption 2: Install from Source
Section titled “Option 2: Install from Source”Clone the repository
Section titled “Clone the repository”git clone github.com/dream-horizon-org/datagenBuild the compiler
Section titled “Build the compiler”make build-compilerNow, source the rc files or fire up a new terminal window for the changes to take effect.
Verify installation
Section titled “Verify installation”datagenc --helpYour First Model
Section titled “Your First Model”Let’s create a simple user model to generate some test data.
model users { fields { name() string age() int }
gens { func name() { return "Arthur Dent" }
func age() { return IntBetween(18, 65) } }}Generate Your First Data
Section titled “Generate Your First Data”Now let’s generate some data from this model:
datagenc gen users.dgOutput:
users{name:Arthur Dent age:42}