Overview
DuckDB::ScalarFunction is missing several features from the DuckDB C API. This issue tracks the full list.
Missing API methods
DuckDB::ScalarFunction
DuckDB::FunctionInfo
New class: DuckDB::ScalarFunction::BindInfo
The bind callback receives a duckdb_bind_info. Scalar-function-specific methods not yet wrapped:
New class: DuckDB::ScalarFunctionSet -> #1221
Enables registering multiple type overloads under the same function name:
Missing type support in input/output handling
Currently handled: BOOLEAN, TINYINT, UTINYINT, SMALLINT, USMALLINT, INTEGER, UINTEGER, BIGINT, UBIGINT, FLOAT, DOUBLE, VARCHAR, BLOB, TIMESTAMP, DATE, TIME
Missing scalar types (straightforward)
Missing complex types (harder, lower priority)
Note: the same type gaps also exist in DuckDB::DataChunk#set_value used by the table function adapter, so fixing these would benefit both APIs.
Overview
DuckDB::ScalarFunctionis missing several features from the DuckDB C API. This issue tracks the full list.Missing API methods
DuckDB::ScalarFunctionDuckDB::FunctionInfoNew class:
DuckDB::ScalarFunction::BindInfoThe bind callback receives a
duckdb_bind_info. Scalar-function-specific methods not yet wrapped:set_bind_data(data, destroy_callback)—duckdb_scalar_function_set_bind_dataset_bind_data_copy(copy_callback)—duckdb_scalar_function_set_bind_data_copyget_extra_info—duckdb_scalar_function_bind_get_extra_infoget_client_context—duckdb_scalar_function_get_client_contextwas moved to Implement expression folding API for ScalarFunction bind callback #1192New class:-> #1221DuckDB::ScalarFunctionSetEnables registering multiple type overloads under the same function name:
DuckDB::ScalarFunctionSet.new(name)—duckdb_create_scalar_function_set#add(scalar_function)—duckdb_add_scalar_function_to_setConnection#register_scalar_function_set(set)—duckdb_register_scalar_function_setMissing type support in input/output handling
Currently handled:
BOOLEAN, TINYINT, UTINYINT, SMALLINT, USMALLINT, INTEGER, UINTEGER, BIGINT, UBIGINT, FLOAT, DOUBLE, VARCHAR, BLOB, TIMESTAMP, DATE, TIMEMissing scalar types (straightforward)
HUGEINT,UHUGEINT— useduckdb_hugeint/duckdb_uhugeintstruct → RubyIntegerTIMESTAMP_S,TIMESTAMP_MS,TIMESTAMP_NS,TIMESTAMP_TZ— same pattern asTIMESTAMPTIME_TZmove to make DuckDB::ScalarFunction acccept time_ns column #1265TIME_NS— same pattern asTIMEINTERVAL— map to/fromDuckDB::IntervalUUID— stored ashugeintinternally, expose asStringDECIMAL— needswidth/scalemetadata from logical typeMissing complex types (harder, lower priority)
LIST,STRUCT,MAP,ARRAY,UNION,ENUM— require recursive child vector handlingNote: the same type gaps also exist in
DuckDB::DataChunk#set_valueused by the table function adapter, so fixing these would benefit both APIs.