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
- Regex Functions
- Conversion Functions
- Null Functions
- UUID 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(), gen_uuid_v4(), gen_uuid_v7(),
current_timestamp(), now(), current_date(), unix_timestamp(), and
random() can return a different value on each evaluation.
String literals in CamusDB SQL can be written with double quotes or single quotes:
SELECT concat("robot-", to_string(year)) AS label
FROM robots;
SELECT concat('robot-', to_string(year)) AS label
FROM robots;