[DRAFT]This page is not published. Only visible in development mode.

Types & Expressions

Everything in RQL is typed. The engine infers types automatically, promotes them when needed, and propagates none according to three-valued logic.

Type System

CategoryTypesNotes
Signed Integersint1, int2, int4, int8, int16, intint is arbitrary precision
Unsigned Integersuint1, uint2, uint4, uint8, uint16, uintuint is arbitrary precision
Floatsfloat4, float8IEEE 754
DecimaldecimalArbitrary precision
Temporaldate, datetime, time, durationCalendar and clock types
Text / Binaryutf8, blobUTF-8 strings and raw bytes
Identifiersuuid4, uuid7Universally unique identifiers
Otherbool, Option(T), List(T)Option wraps nullable values

Automatic Type Promotion

When you mix types in an expression, the engine widens to the larger type. No data loss, no surprises.

$ Integer Widening
$ ctrl+enter to run

Same-family widening: int1 → int2 → int4 → int8. Cross-type: int + float → float.

Float4 promotes to float8 to prevent overflow during arithmetic.

$ Float Promotion
$ ctrl+enter to run

None Handling

RQL uses three-valued logic. none propagates through most operations — if any operand is none, the result is none.

$ None Propagation
$ ctrl+enter to run

Use is::some() and is::none() to test for presence. The null-coalescing operator ?? provides defaults: value ?? fallback.

String Concatenation

The + operator concatenates strings, and it auto-converts non-string types.

$ String Concatenation
$ ctrl+enter to run

Works with bool, int, float, date, datetime, uuid, and blob values.

Type Casting

Use cast(value, type) for explicit conversion between compatible types.

$ Type Casting
$ ctrl+enter to run