Skip to content

Asset register with classes and locations

Assets linked to asset classes and locations, with tags, cost and acquisition dates.

related volume small AssetsLocationsRelationships
Languages
eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table asset_classes rows 4 (
  id   int64 autoincrement primarykey
  name text enum(values: ["equipment", "vehicle", "building", "software"])
)

table locations rows 4 (
  id   int64 autoincrement primarykey
  name text words(maxWords: 2)
)

table assets rows 20 per(asset_classes, 1, 6) (
  id          int64 autoincrement primarykey
  class_id    int64 fk(asset_classes.id)
  location_id int64 fk(locations.id)
  tag         text unique pattern(pattern: "AST-#####")
  cost        decimal(12, 2) decimal(min: 1000, max: 1000000)
  acquired_on date date(min: "2010-01-01", max: "2024-12-31")
)

output csv

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

About this recipe

Asset register

A multi-table recipe that generates an asset register: assets linked to asset classes and locations.

What it demonstrates

  • Relationships — assets references asset_classes and locations.
  • Row distribution — per(asset_classes, 1, 6) gives each class one to six assets.
  • Identity and cost — tag is a unique pattern mask, cost a decimal amount, and acquired_on a date.

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: asset_classes.csv, locations.csv and assets.csv.

Guarantees

Every primary key is unique, every foreign key names an existing parent row, and per(...) grouping holds. Values are synthetic.

Tested features

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

enumwordspatterndecimaldateuniquefkperautoincrementprimary-key