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.
- Languages
eng- Formats
csv
Recipe
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_nois 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_nameis a company (nullable, because individual customers have none) with acontact_nameandcontact_emailthat share asame(person)group, so the contact is one coherent person. - Address block —
phone,postal_code,city,countryandcountry_codeshare asame(geo)group, so they all describe one place;streetis a standalone street name. - Classification —
segmentis a fixedenum(retail, wholesale, partner, vip) andcredit_limitis a bounded decimal amount. - Lifecycle —
customer_sinceis a date range andactiveis 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_nomask to match your source system's reference format. - Add or drop columns to mirror the exact columns of your import template.
- Replace the
segmentvalues with the categories your target system accepts. - Raise
rowsto produce a larger import file. - Adjust the
delimiter,eol,bom,headerormaxRowsPerFileoptions 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