Functions
CamusDB scalar functions can be used anywhere a scalar expression is accepted, including select lists, aliases, filters, nested expressions, and grouped query expressions.
SELECT upper(trim(name)) AS display_name
FROM robots
WHERE abs(year - 2000) <= 5;
Function names are case-insensitive. Most functions return NULL when any
argument is NULL; the category pages call out the functions with different
null handling.
Categories
- String Functions
- Math Functions
- Date/Time Functions
- JSON Functions
- Conversion Functions
- Object Id Functions
General Rules
Arguments are evaluated before the function call. Functions validate their argument count and argument types at execution time.
Volatile functions such as gen_id(), current_timestamp(), now(),
current_date(), unix_timestamp(), and random() can return a different
value on each evaluation.
String literals in CamusDB SQL are written with double quotes:
SELECT concat("robot-", to_string(year)) AS label
FROM robots;