Query
Queries provide a controlled way to retrieve data in Rell.
Queries have the following characteristics:
- Can't modify the data in the database (compile-time verification)
- Must return a value
- If the return type isn't explicitly specified, it's implicitly deducted
- Parameter types and return types must be GTV-compatible
Short form
Compact syntax for straightforward queries:
query q(x: integer): integer = x * x;
Full form
More explicit syntax with a return
statement:
query q(x: integer): integer {
return x * x;
}