Expressions

Expressions show up everywhere in RQL: filters, computed columns, aggregations. They are built from operators, literals, column references, and function calls.

Operators

Arithmetic

OperatorDescriptionExample
+Additionprice + tax
-Subtractiontotal - discount
*Multiplicationquantity * price
/Divisiontotal / count
//Integer divisiontotal // 10
%Moduloid % 2

Comparison

OperatorDescriptionExample
==Equalstatus == "active"
!=Not equalrole != "guest"
>Greater thanage > 18
<Less thanprice < 100
>=Greater or equalcount >= 10
<=Less or equalstock <= 5
~=Pattern matchemail ~= "%@gmail.com"

Logical

OperatorDescriptionExample
&&Logical ANDactive && verified
||Logical ORadmin || moderator
??Null coalescenickname ?? name

Other

OperatorDescriptionExample
->Field accessuser->address
=>Lambda expressionx => x * 2

Built-in Modules

RQL ships with built-in modules for common operations. Call them with the :: syntax.

math

Sums, averages, rounding, and more.

$ math module
$ ctrl+enter to run

text

Lowercase, uppercase, trim, and more.

$ text module
$ ctrl+enter to run

date

Extract, format, and calculate with dates.

$ date module
$ ctrl+enter to run

Case Expression

Use case when you need if/else logic inside a query:

$ Case Expression
$ ctrl+enter to run

Named Arguments

Named arguments make your intent obvious:

$ Named Arguments
$ ctrl+enter to run
Combining Expressions
You can combine expressions freely. Use parentheses when you need to control precedence.