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

Throw better error if database not found #78

Closed
pnadolny13 opened this issue Jul 10, 2023 · 0 comments · Fixed by #96
Closed

Throw better error if database not found #78

pnadolny13 opened this issue Jul 10, 2023 · 0 comments · Fixed by #96

Comments

@pnadolny13
Copy link
Contributor

If a database is specified that doesnt exist then the target returns this error when trying to create the empty table:

Cannot perform CREATE TABLE. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.

Its not clear that the reason for this is because the database wasnt found. If the database is found then its uses it as the default database. We should put a check in place to raise a clear exception when the configured database isnt found. It doesnt look like we're conforming database names right now but its also possible at someone will implement that and some users will be confused when their pre-conformed database name exists but post conformed it does not. So having a clear error message with the database name is important.

pnadolny13 added a commit that referenced this issue Jul 24, 2023
Closes #78

I wanted to write a test to assert the exception gets raised and had a
hard time fitting it into the test framework because by the time I
receive the target in the test methods its already instantiated with the
sample config with the valid database so I cant override it in an
individual test. So I'd need to create a suite and call
get_target_test_class just to run a single test, instead I just ran the
components as a standalone test.

---------

Co-authored-by: Edgar R. M. <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant