Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schemaspy metadata #27

Merged
merged 8 commits into from
Jul 2, 2024
Merged

Schemaspy metadata #27

merged 8 commits into from
Jul 2, 2024

Conversation

joshuashaffer
Copy link
Contributor

Implements a few metadata functions so SchemaSpy mostly works. Issue #26

Statement statement = conn.createStatement();
statement.closeOnCompletion();
ResultSet rs = statement.executeQuery(
"SELECT DISTINCT function_name FROM duckdb_functions() WHERE parameter_types[1] IS NULL");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition doesn't quite work - probably need to exclude vararg functions somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select DISTINCT function_name from duckdb_functions() where length(parameter_types) = 0

??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to look at the varargs and internal columns?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not used consistently??

D select DISTINCT function_name, parameter_types, varargs from duckdb_functions() where parameter_types[1] is null;
function_name parameter_types varargs
map_from_entries [] ANY
list_median [NULL]
... ... ...

Sometimes, they have a type in the Vargas columns; other times, they have an explicit NULL as the first argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mause is this ok solution given the above, given that vargargs aren't handled consistently?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good for now yeah

@Mause Mause merged commit 0e5cd92 into duckdb:main Jul 2, 2024
7 checks passed
@Mause
Copy link
Member

Mause commented Jul 2, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants