FUNCTION

Function reference pages list one or several (when closely related to each other) functions. For this reason, it the section should start with a short paragraph describing the class of functions described in this page and what they are used for. They should also be listed at the top so users can find them easily.

FunctionOne liner description
function_nameThis function only has one syntax.
function_name_2This function has various possible syntax.
......

function_name

SyntaxReturn valueDescription
function_name(arg1,arg2)BOOLEANWhat the function does

Arguments

ArgumentTypeDescription
arg1DOUBLESets the argument for the function.
arg1STRINGSets the other argument for the function. Possible values are value1 to do this, and value2 to do that

Description

function_name requires a longer explanation of the logic because it is a bit complex. In this case, it is good to describe it with some text. It should start by a plain-text explanation. Then branches should be expressed as bullet points. For example a given argument might have various behaviors depending on value

  • true makes it do this. It means that this happens and that might happen.
  • false makes the function do that. So function_name may have this behavior.

Examples

Basic usage

Example description - Scalar result
SELECT function_name(arg1,arg2) FROM table;
function_name
true

With optional arguments

Example description - Table result
SELECT function_name(arg1,arg2,opt1) FROM table;
abfunction_namefunction_name
true47true47
false53false53

With null

Example description - Series result
SELECT function_name(arg1,arg2) FROM table;
abfunction_namefunction_name
true47true47
............
false53false53

function_name_2

SyntaxReturn valueDescription
function_name()INTWhat the function does
function_name(arg1,arg2)LONGA much longer description of what the function does because in this case it turns out that this particular function is slightly more complicated than other functions which are less complicated.

Arguments

ArgumentTypeDescription
arg1DOUBLESets the argument for the function.
arg1STRINGSets the other argument for the function. Possible values are value1 to do this, and value2 to do that

Description

function_name requires a longer explanation of the logic because it is a bit complex. In this case, it is good to describe it with some text. It should start by a plain-text explanation. Then branches should be expressed as bullet points. For example a given argument might have various behaviors depending on value

  • true makes it do this. It means that this happens and that might happen.
  • false makes the function do that. So function_name may have this behavior.

Examples

At minimum, examples need a descriptive title. An optional description can be used to.

Basic usage

Example description - Scalar result
SELECT function_name(arg1,arg2) FROM table;
function_name
true

With optional arguments

Example description - Table result
SELECT function_name(arg1,arg2) FROM table;
abfunction_namefunction_name
true47true47
false53false53

With null

Example description - Series result
SELECT function_name(arg1,arg2) FROM table;
abfunction_namefunction_name
true47true47
............
false53false53