-
Notifications
You must be signed in to change notification settings - Fork 27
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
Refinery migration support #32
Conversation
snowflake-api/src/migration.rs
Outdated
self.exec("BEGIN TRANSACTION").await?; | ||
|
||
for query in queries { | ||
let parsed_query = sqlparser::parser::Parser::parse_sql(&DIALECT, query) |
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.
from what I can see sqlparser dialect doesn't allow for put/get queries or any session control queries (alter session), it seem to follow public api, which is of limited use for this particular library
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.
Ack yeah, you are totally right. Limited snowflake extended dialect coverage means this is worse than a more naiive impl of statement split.
@andrusha still need to fix the merge conflict, but I ripped out the SQL parser and added some code as a workaround to fix an issue with assuming other roles during a migration potentially blocking your ability to write to the migration event table. |
Hey @wseaton, thanks for contribution. IMO separate crate would be better in this case. |
Following the example in klickhouse I've implemented support for refinery embedded migrations.
I did this mainly because I wanted a rust core to build a migration tool to move away from schemachange.
Let me know if you'd prefer this move to another crate.