Skip to content

Generic customer import columns

A flat customer import file: an external reference number, company and contact, a full address block, a segment, a credit limit and a since date.

simple volume small CustomersImportContactGeography
Languages
eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table customers rows 20 (
  id             int64 autoincrement primarykey
  customer_no    text unique pattern(pattern: "CUST-######")
  company_name   text null(20%) company()
  contact_name   text same(person) fullName()
  contact_email  text same(person) email()
  phone          text same(geo) phone()
  street         text street()
  postal_code    text same(geo) postcode()
  city           text same(geo) city()
  country        text same(geo) country()
  country_code   text same(geo) countryCode()
  segment        text enum(values: ["retail", "wholesale", "partner", "vip"])
  credit_limit   decimal(12, 2) decimal(min: 0, max: 250000)
  customer_since date date(min: "2015-01-01", max: "2025-12-31")
  active         boolean boolean(trueRate: 90%)
)

output csv (header: true, delimiter: ";", eol: crlf, bom: true, maxRowsPerFile: 8)

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

Customer import

A single-table recipe that generates a flat customer import file: one row per customer, shaped like the interchange CSV an integration tool or spreadsheet would hand to a target system. It is a generic import shape, not compliance with any named ERP.

What it demonstrates

  • External reference — customer_no is a source-system code (CUST-######) and is unique, the way an import file carries its own key instead of relying on an internal id.
  • Business identity — company_name is a company (nullable, because individual customers have none) with a contact_name and contact_email that share a same(person) group, so the contact is one coherent person.
  • Address block — phone, postal_code, city, country and country_code share a same(geo) group, so they all describe one place; street is a standalone street name.
  • Classification — segment is a fixed enum (retail, wholesale, partner, vip) and credit_limit is a bounded decimal amount.
  • Lifecycle — customer_since is a date range and active is a boolean status flag.
  • CSV encoding options — the output is a semicolon-delimited CSV with a header row, CRLF line endings and a UTF-8 BOM (Excel-friendly), split into files of up to eight rows each.

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 table files (customers.csv, split when a file reaches eight rows), holding twenty rows in total.

Adapt it

  • Change the customer_no mask to match your source system's reference format.
  • Add or drop columns to mirror the exact columns of your import template.
  • Replace the segment values with the categories your target system accepts.
  • Raise rows to produce a larger import file.
  • Adjust the delimiter, eol, bom, header or maxRowsPerFile options to match the encoding your target system expects.

Guarantees

Every row has a unique id and a unique customer_no, the contact name and e-mail stay coherent per person, and the geography columns describe one place per row. Values are synthetic and do not reference real people or companies.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

patterncompanyfullNameemailphonestreetpostcodecitycountrycountryCodeenumdecimaldatebooleannulluniqueautoincrementprimary-keysame:personsame:geographycsv.headercsv.delimitercsv.eolcsv.bomcsv.maxRowsPerFile