Repository navigation
Make functions discoverable from duckdb_functions() - #13
Merged
Merged
Conversation
Register table_diff, table_diff_summary and schema_diff through CreateTableFunctionInfo with a FunctionDescription (description, one runnable example with its result as a trailing comment, categories), and name the two positional parameters left / right in the signature so duckdb_functions() no longer reports col0 / col1. on_conflict is set to ALTER_ON_CONFLICT to match the bare RegisterFunction overload. Adds test/sql/function_metadata.test covering the metadata and the examples' output. Closes #11 Co-Authored-By: Claude <noreply@anthropic.com>
Join two lines in the new registration helpers as clang-format 11 wants, and reflow the CMAKE_CXX_STANDARD line as cmake-format wants (the v2.0 code-quality check also formats CMakeLists.txt; main fails on it since the v2.0.0 upgrade). Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11.
Summary
All three table functions now carry metadata in
duckdb_functions():descriptionexamplescategoriesdiff,data_quality)col0, col1, …left, right, pk, …How
CreateTableFunctionInfowith aFunctionDescription.on_conflict = ALTER_ON_CONFLICTmatches what the bareRegisterFunction(TableFunction)overload does.desc.parameter_names. In DuckDB 2.0,duckdb_functions()reads names from the signature (FunctionSignature::GetParameters());FunctionDescription::parameter_namesis only a fallback when the counts don't match. The relation arguments are registered as positional-onlyleft/right, so call syntax is unchanged and "no matching function" errors now showtable_diff(left VARCHAR, right VARCHAR, /, *, pk ANY, …).VALUES, so they run on a fresh connection with no setup.Test plan
make test: 11/11 pass, including the newtest/sql/function_metadata.test(names, description/examples/categories present, and each example's output)examples[1]for each function out ofduckdb_functions()and ran the result with.read: all three run as written and match their comments🤖 Generated with Claude Code