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

fix: qualify catalog names with schema names in get_schema_names #740

Merged
merged 7 commits into from
Dec 9, 2023

Conversation

Alex-Monahan
Copy link
Collaborator

Due to having multiple databases in DuckDB, the Postgres dialect of get_schema_names has duplicates (Ex: one copy of "main" for every database, including temp and system).

This is a draft because it has no tests! I just wanted to post here to get some quick feedback and I'll definitely add some tests in the next day or two. If you have specific advice or requests for tests, definitely let me know!

I tried to only wrap things in double quotes when absolutely necessary (if there are spaces or quotes within the database or schema name). Let me know if you think this will work!

One other factor is that we could go back and edit DuckDB core's pg_namespaces catalog to include the database name as the namespace. Then we could query pg_namespaces instead of duckdb_schemas. I'm not sure if that is something we want to do though!

@Alex-Monahan Alex-Monahan requested a review from Mause July 28, 2023 00:19
duckdb_engine/__init__.py Outdated Show resolved Hide resolved
@Mause Mause changed the title db_name.schema_name in get_schema_names fix: qualify catalog names with schema names in get_schema_names Jul 28, 2023
@Alex-Monahan
Copy link
Collaborator Author

Does this look any better? The test that I wrote for this function passes, but there are other failures. 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