-
Notifications
You must be signed in to change notification settings - Fork 493
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
Setting context on migration transactions #195
Conversation
I wonder if folks in the community are using the goose helper functions directly, e.g., It may be safer to either cut a new v3.0.0 or introduce new functions to keep backwards compat. @VojtechVitek let's chat when you have some time. |
We’re using all of these methods (Up, Down etc) to run migrations from Go apps. Introducing new methods is probably the best way to go. A v3 may make it clear that there’s breaking changes but won’t remove the element of surprise and extra work for upgrades. It will also require changes for anyone wishing to get access to features and fixes post v3. |
fyi: merged in c9s/goose@472052d |
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.
I like this contribution. However, it's breaking the API.
We'll need to add new context-aware functions, ie. DownCtx()
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.
@mfridman it's too bad we never got to merging this.
I think adding the extra *Ctx()
function is fine and doesn't break the existing API. I like this PR.
Agreed. Not sure if @diogogmt wants to see this one through (3 years later 😅) .. but I can pick this up and commandeer it to completion. I think there is value in having this be an option in the current branch without breaking the API. |
@mfridman it has been a while! I can update the PR. We have been running a forked version propagating the context cancelation signal to the SQL statements here at Blockthrough. It would be great to have it merged upstream. |
@VojtechVitek Is there anything blocking this change? Can I help somehow? |
I wasn't aware of this PR and opened #517 with the same intention. |
Superseded by #517 |
This PR allows a context to be set in the database transactions used to run .go and .sql migrations.
db.BeginTx is called Instead of db.Begin which allows the caller the following options: