Light
Dark
System
v4latest
v4latest
v3
v2
v1

Functions

This page documents how to define custom functions, however EdgeDB provides a large library of built-in functions and operators. These are documented in Standard Library.

Functions are ways to transform one set of data into another.

It is also possible to define custom functions. For example, consider a function that adds an exclamation mark '!' at the end of the string:

Copy
function exclamation(word: str) -> str
  using (word ++ '!');

This function accepts a str as an argument and produces a str as output as well.

Copy
test> 
select exclamation({'Hello', 'World'});
{'Hello!', 'World!'}
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.