| sidebar_position | 1.8 |
|---|---|
| title | Schema Definition |
| description | Full reference for schema text format, field rules, and IF ... THEN schema constraints. |
The schema editor in app.html and generate.html uses a plain text format.
This page explains:
- how field rules are written
- how schema constraints are written
- which operators are supported
- how constraints affect generated data
- copy-paste examples you can use directly in the tool
A schema is usually written as repeating two-line field definitions:
Column Name
rule definition
Example:
Status
enum("Open","In Progress","Closed")
This creates one output column called Status.
You can also use a compact inline form when you prefer a PICT-style layout:
Status: enum("Open","In Progress","Closed")
For enum-heavy schemas, a shorter name: values form is also supported:
Browser: Chrome,Firefox,Safari
Theme: Light,Dark
Both formats are supported, and you can mix them in the same schema.
Use a literal when every generated row should contain the same value.
Build
literal(1.0.0)
This always generates 1.0.0.
Use an enum when the column should be chosen from a fixed set of values.
Priority
enum("High","Medium","Low")
This generates one of High, Medium, or Low.
Use a regex when the value should match a pattern.
Ticket Id
[A-Z]{3}-\d{4}
This generates values such as ABC-1234.
Use a domain method for realistic generated values.
Customer Name
person.fullName
CreatedAt
autoIncrement.timestamp(start="2026-06-12T12:39:23Z", step=1, type="seconds")
The Customer Name example generates names such as Alice Smith. The CreatedAt example generates deterministic timestamps for time-ordered rows.
You can use blank lines to make a schema easier to read.
Lines starting with # are treated as comments.
Example:
# Core workflow fields
Priority
enum("High","Medium","Low")
# User-facing status
Status
enum("Open","Closed")
Schema constraints restrict which combinations of values are allowed.
The currently supported constraint form is:
IF predicate THEN predicate
You can terminate a constraint with either:
;ENDIF
Both of these are valid:
IF [Priority] = "High" THEN [Status] = "Open";
IF [Priority] = "High" THEN [Status] = "Open" ENDIF
Constraints do not assign or mutate values after generation.
Instead, they define which rows are valid.
The generator creates candidate rows, checks them against the constraints, and keeps only rows that satisfy all constraints.
For example:
Priority
enum("High","Low")
Status
enum("Open","Closed")
IF [Priority] = "High" THEN [Status] = "Open";
Meaning:
- rows with
Priority = Highare only valid ifStatus = Open - rows with
Priority = Lowcan have eitherOpenorClosed
So High + Closed should never appear in generated output.
Inside constraints, column names must be written in square brackets:
[Priority]
[Status]
[Ticket Id]
Important:
- use the exact schema column name
- bracketed names are required inside constraints
- spaces are allowed inside the brackets
Example:
IF [Ticket Status] = "Open" THEN [Resolution Code] = "";
Supported comparison operators are:
=<>>>=<<=
Example:
IF [Age] >= 18 THEN [Access Level] = "Adult";
Notes:
- use
<>for "not equal" !=is not supported
LIKE checks a wildcard pattern.
Supported wildcard characters are:
*for any number of characters?for a single character
Example:
IF [Code] LIKE "QA-*" THEN [Environment] = "Test";
Meaning:
- if
Codestarts withQA-, thenEnvironmentmust beTest
Example:
IF [Code] NOT LIKE "QA-*" THEN [Environment] = "Production";
Meaning:
- if
Codedoes not start withQA-, thenEnvironmentmust beProduction
IN checks whether a value is one of a listed set.
The current schema format uses curly braces:
IF [Priority] IN {"High","Critical"} THEN [Escalated] = "Yes";
Meaning:
- if
Priorityis eitherHighorCritical, thenEscalatedmust beYes
Example:
IF [Priority] NOT IN {"High","Critical"} THEN [Escalated] = "No";
Meaning:
- if
Priorityis neitherHighnorCritical, thenEscalatedmust beNo
Supported logical operators are:
ANDORNOT
You can also use parentheses for grouping.
IF [Priority] = "High" AND [Status] = "Open" THEN [Owner] <> "";
Meaning:
- when both conditions are true,
Ownermust not be blank
IF [Region] = "UK" OR [Region] = "IE" THEN [Currency] = "GBP";
Meaning:
- if the region is
UKorIE, then currency must beGBP
IF NOT ([Status] = "Closed") THEN [Remaining Work] <> "0";
Meaning:
- if status is not
Closed, then remaining work must not be0
Constraints can compare against:
- quoted string values, e.g.
"Open" - numeric values, e.g.
18 - other parameters, e.g.
[Min Age] <= [Max Age]
Min Age
number.int({"min": 18, "max": 50})
Max Age
number.int({"min": 18, "max": 65})
IF [Min Age] > [Max Age] THEN [Max Age] >= [Min Age];
Meaning:
- any row where
Min Ageis greater thanMax Ageis only valid ifMax Ageis at leastMin Age - in practice, this prevents invalid min/max ordering
Constraints are validated against the schema.
This is invalid because [Severity] is not defined in the schema:
Priority
enum("High","Low")
IF [Severity] = "Critical" THEN [Priority] = "High";
This is invalid because Urgent is not in the enum:
Priority
enum("High","Medium","Low")
IF [Priority] = "Urgent" THEN [Priority] = "High";
This is invalid because bob does not match the regex:
Ticket Id
[A-Z]{3}-\d{4}
IF [Ticket Id] = "bob" THEN [Status] = "Open";
This is invalid because the only literal value is Closed:
Status
literal(Closed)
IF [Status] = "Closed" THEN [Status] = "Open";
Some constraints are syntactically valid and can reference valid columns and values, but still make row generation impossible.
These cases are not always discoverable during schema parsing or validation. They may only be found when the generator starts creating rows and repeatedly fails to find a valid combination.
Example:
Status
enum("Open","Closed")
IF [Status] = "Open" THEN [Status] = "Closed";
IF [Status] = "Closed" THEN [Status] = "Open";
Illustrates:
- a schema that parses correctly
- constraints that use valid enum values
- a rule set that makes every possible row invalid
Meaning:
- if
StatusisOpen, the row is only valid whenStatusisClosed - if
StatusisClosed, the row is only valid whenStatusisOpen - no generated row can satisfy both possibilities
When this happens, the tool reports:
Schema Constraints are impacting row generation - generated X rows, failed to generate Y rows. Consider changing constraints to improve row generation.
Important:
- this condition is only found and reported during generation
- care must be taken when writing constraints, especially when combining multiple rules
- a schema can be structurally valid but still impossible to generate data from
Constraints are supported during pairwise and n-wise generation only when every referenced constrained field is an enum column.
That means:
- constrained pairwise and n-wise generation works best for enum-only decision tables
- if a constraint references non-enum fields such as regex, literal, or domain-generated values, normal random generation is supported, but combinatorial generation is not
Each example below is complete and can be pasted directly into the tool.
Illustrates:
- enum fields
- simple equality constraint
Priority
enum("High","Medium","Low")
Status
enum("Open","Queued","Closed")
IF [Priority] = "High" THEN [Status] = "Open";
Meaning:
Highpriority rows must useOpen
Illustrates:
IN- set-based trigger conditions
Priority
enum("Critical","High","Medium","Low")
Escalated
enum("Yes","No")
IF [Priority] IN {"Critical","High"} THEN [Escalated] = "Yes";
Meaning:
CriticalandHighrows must be escalated
Illustrates:
NOT IN- inverse constraint logic
Priority
enum("Critical","High","Medium","Low")
Escalated
enum("Yes","No")
IF [Priority] NOT IN {"Critical","High"} THEN [Escalated] = "No";
Meaning:
MediumandLowrows must not be escalated
Illustrates:
- regex field definition
LIKE
Ticket Id
[A-Z]{3}-\d{4}
Queue
enum("Support","QA","Ops")
IF [Ticket Id] LIKE "QA-*" THEN [Queue] = "QA";
Meaning:
- values starting with
QA-must use theQAqueue
Illustrates:
AND- multiple field dependency
Priority
enum("High","Low")
Status
enum("Open","Closed")
Owner
enum("Alice","Bob","")
IF [Priority] = "High" AND [Status] = "Open" THEN [Owner] <> "";
Meaning:
- a high-priority open item must have an owner
Illustrates:
OR- parentheses
Region
enum("UK","IE","US","CA")
Currency
enum("GBP","USD","CAD")
IF ([Region] = "UK" OR [Region] = "IE") THEN [Currency] = "GBP";
Meaning:
- both
UKandIErows must useGBP
Illustrates:
- numeric comparison
>=
Age
number.int({"min": 16, "max": 21})
Access
enum("Restricted","Adult")
IF [Age] >= 18 THEN [Access] = "Adult";
Meaning:
- anyone aged 18 or older must have
Adultaccess
Illustrates:
ENDIFterminator
Priority
enum("High","Low")
Status
enum("Open","Closed")
IF [Priority] = "High" THEN [Status] = "Open" ENDIF
Meaning:
- same as the semicolon form
- the choice of terminator is author preference
Use schema constraints when generated rows need business rules, dependencies, or realistic combinations.
The most important points are:
- write schema fields as column/rule pairs
- reference columns in constraints with
[Bracketed Names] - use
IF ... THEN ... - terminate constraints with
;orENDIF - use
<>rather than!= - use constraints to filter invalid rows, not to mutate rows after generation