Expand description
Built-in functions and procedures the engine VM dispatches to. Functions are pure value transformations evaluated mid-query (math, string, json, temporal, casting); procedures are imperative routines that may mutate catalog or storage state and are invoked as named statements. Both are exposed to RQL through stable qualified names that become wire-visible identifiers.
The crate registers every built-in routine with the catalog at boot and resolves user-invoked names against that registry. Renaming a registered routine is a breaking change for queries already on disk, in scripts, and in client code; new routines should be added rather than substituted.
Modules§
- function
- Built-in functions: pure, side-effect-free transformations the engine evaluates as part of expression
evaluation. Grouped by domain - blob, temporal, json, math, identity introspection, RQL meta-queries, type
predicates - each with a stable qualified name like
json::arrayormath::absthat becomes part of the query language surface. - procedure
- Built-in procedures: imperative routines users invoke as named statements. They may mutate catalog or storage state, take typed argument lists, and return zero or more result columns. Identity management, subscription control, set operations, clock manipulation in tests - anything that does not fit cleanly into a function goes here.
- routine
- Common machinery shared by both functions and procedures: the routine registry the engine consults at invocation time, the per-call context that exposes engine services to a routine body, and the typed errors a routine can return. The split between function and procedure semantics happens above this module; everything here is name resolution, argument binding, and result shaping that both kinds need.