Skip to main content

Module function_name

Module function_name 

Source
Expand description

SQL function name validation for DuckDB extensions.

A function name that needs quoting in SQL, or that cannot survive the trip through a C string, will fail at registration or produce a function nobody can call. This validator rejects those, and nothing else.

§What it deliberately does not do

It does not impose a naming style. DuckDB identifiers are case-insensitive and DuckDB itself ships mixed-case functions (formatReadableSize, formatReadableDecimalSize), so myFunc registers fine and is callable as myfunc, MYFUNC or myFunc — verified against DuckDB 1.5.5. snake_case is the overwhelming convention in DuckDB’s own catalog and is worth following, but it is a convention, not a rule, and this validator gates ScalarFunctionBuilder::try_new — so enforcing it here would make a legitimate function name unregisterable.

Constants§

DUCKDB_RESERVED_KEYWORDS
DuckDB’s reserved SQL keywords, lowercase and sorted.
DUCKDB_UNCALLABLE_KEYWORDS
Non-reserved keywords that still cannot be a function’s name, lowercase and sorted.
DUCKDB_UNREFERENCEABLE_PARAMETER_KEYWORDS
Non-reserved keywords that cannot be a macro parameter’s name, lowercase and sorted.

Functions§

validate_function_name
Validates a DuckDB function name.
validate_parameter_name
Validates a macro parameter name.