DATA MODEL
Entities & data types
Entities are the core domain-model construct in RAIQL. They describe named records and the fields expected by generators and downstream tooling.
Entity declaration
CREATE ENTITY Customer (
id UUID PRIMARY,
email STRING REQUIRED UNIQUE,
displayName STRING,
createdAt DATETIME REQUIRED
);Data types
STRINGText valuesUUIDUnique identifiersINT / INTEGERWhole numbersDECIMAL / FLOAT / DOUBLE / NUMBERNumeric valuesBOOLEAN / BOOLTrue/false valuesDATE / DATETIME / TIMESTAMPDate and time values
Field modifiers
PRIMARY, REQUIRED and UNIQUE are preserved as field modifiers. A primary or required field is emitted as non-optional in the generated TypeScript model.
Relationships
Use RELATE to connect a field on one entity to a field on another entity.
RELATE Order.customerId TO Customer.id;The compiler validates both referenced entity names before accepting the relationship.
Cross-reference validation
RAIQL rejects relationships, CRUD declarations and API declarations that reference unknown entities. This prevents downstream generators from receiving structurally invalid intent.
Continue exploring RAIQLOpen the playground →