Skip to content

Generator reference

A generator owns one column and produces its base value. The compiler checks the generator’s accepted SQL families and validates its arguments. Modifiers run afterward in the order declared.

When a generator reads sibling columns on the same row — copy, template, slug, and before/after do — the engine evaluates each column after the columns it reads, following the read dependencies rather than the order columns are declared. A derived column may therefore appear anywhere in the schema, before or after its source. A read whose source has not been produced yet (or a generator reading its own column) sees no value; a set of columns that read each other in a cycle is rejected at compile time as GEN-COLUMN-CYCLE. Columns that read nothing keep their declared schema order.

columns:
email:
generator: { kind: internet.email }
modifiers:
- { kind: case, mode: lower }
- { kind: unique, max_attempts: 20 }
NeedStart with
IDs and deterministic counterssequence, uuid, monotonic
Bounded random primitivesinteger, decimal, boolean, string
Realistic domain-shaped textSemantic generators
Passwords, tokens, and secretsCredential generators
Preserve an observed distributionObserved and statistical generators
Foreign-key valuesRelationship generators or a planner
Derive from another columncopy, template, before/after
Let the database fill the valuedatabase_default
  • kind is required and must name a registered generator or alias.
  • Unknown arguments are rejected. Required arguments are checked by both the published schema and the compiler.
  • A generator can attach only to a compatible schema.columns[].family.
  • Cross-column generators may read only columns that exist and are ordered before them without forming a dependency cycle.
  • Every generator is deterministic under a fixed seed unless its documentation explicitly says otherwise. All current built-ins are deterministic.
  • A generator that embeds literal choices can trigger the non-fatal GEN-SOURCE-VALUES advisory. See Privacy.
  • Core — primitives, categorical values, templates, IDs, and defaults
  • Semantic — names, addresses, internet, commerce, temporal, and file shapes
  • Credentials — synthetic-only secrets and placeholders
  • Observed and statistical — samples, histograms, distributions, and monotonic values
  • Relationships — ordinary and composite foreign keys

For correlated multi-column or cross-table invariants, use a planner instead of independent generators.