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
| Category | Types | Notes |
|---|---|---|
| Signed Integers | int1, int2, int4, int8, int16, int | int is arbitrary precision |
| Unsigned Integers | uint1, uint2, uint4, uint8, uint16, uint | uint is arbitrary precision |
| Floats | float4, float8 | IEEE 754 |
| Decimal | decimal | Arbitrary precision |
| Temporal | date, datetime, time, duration | Calendar and clock types |
| Text / Binary | utf8, blob | UTF-8 strings and raw bytes |
| Identifiers | uuid4, uuid7 | Universally unique identifiers |
| Other | bool, 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.
Same-family widening: int1 → int2 → int4 → int8. Cross-type: int + float → float.
Float4 promotes to float8 to prevent overflow during arithmetic.
None Handling
RQL uses three-valued logic. none propagates through most operations — if any operand is none, the result is none.
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.
Works with bool, int, float, date, datetime, uuid, and blob values.
Type Casting
Use cast(value, type) for explicit conversion between compatible types.
