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
DuckDBfunction name. - validate_
parameter_ name - Validates a macro parameter name.