Customer master data with addresses and contacts
Customers with related addresses and contact people.
- Languages
eng- Formats
csv
Recipe
gbddl 1
language eng
table customers rows 10 (
id int64 autoincrement primarykey
name text company()
)
table addresses rows 15 per(customers, 1, 2) (
id int64 autoincrement primarykey
customer_id int64 fk(customers.id)
street text street()
city text same(geo) city()
country text same(geo) country()
postcode text same(geo) postcode()
kind text enum(values: ["billing", "shipping"])
)
table contacts rows 20 per(customers, 1, 3) (
id int64 autoincrement primarykey
customer_id int64 fk(customers.id)
full_name text same(person) fullName()
email text same(person) email()
phone text phone()
)
output csv
This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.
About this recipe
Customer master data
A multi-table recipe that generates customer master data: customers with related addresses and contact people.
What it demonstrates
- Relationships —
addressesandcontactsreferencecustomers. - Address coherence —
street,city,countryandpostcodedescribe one place, withcity,countryandpostcodein asame(geo)group. - Contact coherence —
full_nameandemailshare asame(person)group.
Run it
Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it
into Chef, to generate the data. The repository's local runner (run by
task test) also generates it and verifies its output.
The recipe outputs CSV files: customers.csv, addresses.csv and
contacts.csv.
Guarantees
Every foreign key names an existing parent row, per(...) grouping holds, and
address and contact fields are coherent per row. Values are synthetic.
Tested features
Smart types, physical types, rules and formats this recipe exercises and verifies.
companystreetcitycountrypostcodeenumfullNameemailphonesame:geographysame:personfkperautoincrementprimary-key