-
Notifications
You must be signed in to change notification settings - Fork 104
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
Adding USE [{{relation.database}}] where appropriate in adapters.sql #111
Conversation
Fixes #110. I messed with `adapters.sql` until changing databases became possible. Did a little bit of refactoring while I was at it... I couldn't figure out how to run the unit tests so hoping the CI will reject the PR if something's wrong with it...
This is kind of cool and the CI passes. The CI runs on SQL Server 2019. But we have committed to support older version of SQL Server. I think down to 2012 and I don't think the |
USE [{{ relation.database }}] | ||
DROP VIEW IF EXISTS {{ relation.include(database=False) }} | ||
DROP TABLE IF EXISTS {{ relation.include(database=False) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reason we're using the object_id()
calls is because IF EXISTS
wasn't added to SQL Server until 2016, which @mikaelene already mentioned. Can you see a way of getting the USE
statement to play nicely with the IF object_id()
piece?
you're right that would be super helpful! I opened #112 to do this |
@panasenco this is awesome -- thanks! It also fixes #59. One more note is that you and I are on the same wavelength in that we both implemented some similar work recently. As a favor, can you try pulling in my changes in #92? I think it'll make your changes easier to make and more clear for us to review! |
Sure @swanderz, I'll pull your changes and switch back to using object_id. I won't be able to do it today, but will work on this as soon as I get a chance. Bump this if I forget. |
@panasenco Hi! Can I create new PR based on your code but with using object_id() instead of "drop if exists"? |
Sure thing @semcha sorry I haven't found the time to do a proper cleanup... Please go ahead! |
Should this be closed in favour for #126? |
Fixes #110. I messed with
adapters.sql
until changing databases became possible. Did a little bit of refactoring while I was at it...I couldn't figure out how to run the unit tests so hoping the CI will reject the PR if something's wrong with it...