Skip to content

Single Field Model

This example demonstrates the simplest possible datagen model: a single field with a static value.

Create a file named users.dg:

users.dg
model users {
fields {
name() string
}
gens {
func name() {
return "John Doe"
}
}
}
Terminal window
$ datagenc gen . -f csv -n 3
Terminal window
$ cat users.csv
name
John Doe
John Doe
John Doe