Skip to main content

Module function

Module function 

Source
Expand description

The built-in function registry: names, arities, and identities.

Invariant: a function is recognised here or it does not exist. The binder resolves a name to one of these identities and refuses everything else with “no such function”, so an unknown name fails at prepare time rather than part-way through a scan, and the VM never dispatches on a string.

Arity is checked here too, because SQLite reports “wrong number of arguments to function abs()” from prepare rather than from execution.

Structs§

ExternalFunction
A function an application registered, as the binder needs to see it.
FunctionEntry
One row of PRAGMA function_list.
FunctionFlags
What a registered function promises about itself.

Enums§

AggregateFunc
An aggregate built-in.
CallSite
Which context a name is being resolved from.
JsonFunc
A JSON built-in.
MathFunc
A math built-in.
ScalarFunc
A scalar built-in.
TimeFunc
A date or time built-in.
WindowFunc
A window function that is not an aggregate.

Constants§

DETERMINISTIC_FLAG
The bit function_list sets for a function that answers the same twice.
INNOCUOUS_FLAG
The bit function_list sets for a function a schema may safely call.

Functions§

aggregate_arity_ok
Returns whether an argument count is legal for an aggregate.
every_function
Returns every built-in this build has, in the order function_list reports.
is_aggregate_call
Returns whether a folded name may be an aggregate at this argument count.
lookup_aggregate
Returns the aggregate a folded name spells.
lookup_external
Returns the registration that answers a call, preferring an exact arity.
lookup_json
Returns the JSON function a folded name spells.
lookup_math
Returns the math function a folded name spells.
lookup_scalar
Returns the scalar function a folded name spells.
lookup_time
Returns the date or time function a folded name spells.
lookup_window
Returns the window function a folded name spells.
minmax_aggregate
Returns the aggregate a min/max call resolves to at one argument.
needs_a_component
Returns what a name needs, when the name is one this build left out.
scalar_arity_ok
Returns whether an argument count is legal for a scalar function.
schema_refusal
Returns why a schema may not call this function, or nothing when it may.