Skip to content

Customer master data with addresses and contacts

Customers with related addresses and contact people.

related volume small CustomersContactRelationships
Languages
eng
Formats
csv

Recipe

recipe.gbddl
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 — addresses and contacts reference customers.
  • Address coherence — street, city, country and postcode describe one place, with city, country and postcode in a same(geo) group.
  • Contact coherence — full_name and email share a same(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