Skip to content

GBDDL recipe language

GBDDL is the human-readable syntax for the canonical recipe model. A recipe declares tables and ends with one output projection. The gbddl 1 version header is optional; omitting it selects version 1. JSON uses the same model for machine clients.

orders.gbddl
gbddl 1

table orders rows 20 (
  id    int64 autoincrement primarykey
  total decimal(8, 2) decimal(min: 0, max: 500)
)

output json

The language structure and rules are listed below. Smart types and rule arguments are listed in the generated type reference.

Grammar

The parser accepts the GBDDL v1 grammar, preserves comments while formatting, and reports source positions for syntax and validation errors. The physical types and rule names below are generated from the current implementation.

Tables, columns and rules

A recipe contains one or more named tables. A table declares its row count and a parenthesized list of columns. Each column has a physical type, zero or one smart type, and optional shaping or relational rules. Physical types describe the encoded value shape; smart types construct realistic or constrained values.

Common rules include primarykey, unique, distinct, and null(percent). Relational rules include fk(parent.column), eq(column), and comparisons such as gt(column) or lte(column). same(family) coordinates related values such as a person's name and e-mail. per(parent, min, max) controls child row counts. embed(child) projects child rows into a document output.

The physical types and rule names are generated from the GBDDL model:

Physical types

boolean, int16, int32, int64, decimal, float64, text, varchar, date, time, timestamp, timestamptz, uuid, bytes

Rules

Rule
primarykey
unique
null
fk
autoincrement
distinct
eq
gt
gte
lt
lte
language
same
per

Language and limits

language(...) declares language preferences. A missing vocabulary falls back to eng. Names are limited to 63 UTF-8 bytes; static tables have at most 10 rows. Policy ceilings such as tables, columns, cells and PDF pages are editable by operators and are checked before charging. See guarantees for behavior that depends on inputs.

Packages, manifests and load scripts

Package projections can include generated data, a format manifest and a database load script where supported. The load script depends on the destination database schema and configuration supplied by the user.

Recipe blocks published here are parsed, semantically validated, and format-checked by the website tests.

Complete, runnable examples live in the recipe library, each with a copyable source file, tested features, and a link to its raw recipe.gbddl.

Canonical JSON recipes

Set the required input_format query parameter to gbddl for GBDDL text or json for the canonical model. Content-Type does not select the input format. Inference (/api/v1/gbddl/infer) is the exception: there input_format names the sample, json, csv or tsv, and the response is GBDDL text, which can be submitted with input_format=gbddl.

The canonical JSON Schema describes the structural contract. The downloadable JSON example is equivalent to the customers recipe in the documentation overview. Both links are also available from the public /api/v1/reference response as recipe_schema and recipe_example. Semantic rules and current limits are checked by /api/v1/gbddl/validate?input_format=json.

customers.json
{
  "version": 1,
  "tables": [
    {
      "name": "customers",
      "rows": 3,
      "columns": [
        {
          "name": "id",
          "type": {
            "name": "int64"
          },
          "autoIncrement": {
            "start": 1,
            "step": 1
          }
        },
        {
          "name": "name",
          "type": {
            "name": "text"
          },
          "generator": {
            "name": "fullName"
          }
        },
        {
          "name": "email",
          "type": {
            "name": "text"
          },
          "generator": {
            "name": "email"
          }
        }
      ],
      "primaryKey": [
        "id"
      ]
    }
  ],
  "output": {
    "format": "csv"
  }
}