Light
Dark
System
v4latest
v4latest
v3
v2
v1

Function calls

EdgeDB provides a number of functions in the standard library. It is also possible for users to define their own functions.

The syntax for a function call is as follows:

function_name "(" [argument [, argument, ...]] ")"

where argument is:

expr | identifier := expr

Here function_name is a possibly qualified name of a function, and argument is an expression optionally prefixed with an argument name and the assignment operator (:=) for named only arguments.

For example, the following computes the length of a string 'foo':

Copy
db> 
select len('foo');
{3}

And here’s an example of using a named only argument to provide a default value:

Copy
db> 
select array_get(['hello', 'world'], 10, default := 'n/a');
{'n/a'}
Light
Dark
System

We use ChatGPT with additional context from our documentation to answer your questions. Not all answers will be accurate. Please join our Discord if you need more help.