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

database_exists for Snowflake: returns true even though database does not exist #654

Closed
YYYasin19 opened this issue Oct 31, 2022 · 2 comments
Assignees
Labels

Comments

@YYYasin19
Copy link

Checking whether a database exists for snowflake connection strings currently does not work.
The issue seems to be that the query SELECT 1 is evaluated by the Snowflake query engine without the need for a concrete database existence; thus the result is 1 even though the referenced database might not exist.

The solution would be to just add another case for Snowflake and validate the existence with a Snowflake-specific query.

Another option would be to check whether the snowflake case is covered by another database engine and then handle those together.
➡️ Unfortunatenly, for postgresql and mysql this does not seem to be the case. Other open implementations, e.g. #414, do not seem to handle this as well.

Should I open a quick PR for this? Or is there maybe a cleaner solution?

@kurtmckee
Copy link
Collaborator

sqlalchemy-utils doesn't currently support Snowflake databases. I just checked and found that Snowflake offers no free tier for open source projects, so there isn't a way to test sqlalchemy-utils locally or in CI and begin supporting this.

For this reason, I don't see a path to add Snowflake support. You will need to re-implement database_exists() in your own code, unfortunately.

@kurtmckee kurtmckee self-assigned this Oct 31, 2022
@YYYasin19
Copy link
Author

You're right and this is a valid reason. ✅
I will try to update if something changes in this regard. Either way it's documented now.
Thanks! :)

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

No branches or pull requests

2 participants