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

Refinery migration support #32

Closed
wants to merge 16 commits into from
Closed

Conversation

wseaton
Copy link
Contributor

@wseaton wseaton commented Mar 7, 2024

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.

self.exec("BEGIN TRANSACTION").await?;

for query in queries {
let parsed_query = sqlparser::parser::Parser::parse_sql(&DIALECT, query)
Copy link
Owner

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

Copy link
Contributor Author

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.

@wseaton
Copy link
Contributor Author

wseaton commented Mar 11, 2024

@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.

@dmzmk
Copy link
Collaborator

dmzmk commented May 4, 2024

Hey @wseaton, thanks for contribution. IMO separate crate would be better in this case.

@wseaton wseaton closed this Jun 6, 2024
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.

3 participants