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

check if schema exists before calling DETACH DATABASE #15

Merged
merged 1 commit into from
May 8, 2022

Conversation

codeforkjeff
Copy link
Owner

@codeforkjeff codeforkjeff commented May 8, 2022

sqlite doesn't support IF EXISTS for DETACH DATABASE so we check manually. Note that we have to commit before detaching, otherwise sqlite will raise a 'database is locked' error.

This issue was exposed when changing the test suite to use the new framework for dbt-core 1.1.0. The old test suite for 1.0.x isn't raising any errors, but fixing this anyway. It's not clear to me that this ever comes up in real world use cases.

@codeforkjeff codeforkjeff merged commit a463752 into main May 8, 2022
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.

1 participant