Added execution of multiple statement at once with two tests #296
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I'm pretty new to Go and I've tried to do something here, please give me advice if I did something wrong. I'm also new to the GitHub workflow so if you have any advice I'll gladly take them.
I'm using a tool called migrate (https://github.com/mattes/migrate). The tools allows for database refactoring. The tool currently support MySQL in an experimental matter. One of the problem is that the migration are done reading files and as you probably know, SQL file can contains multiple statement to be executed one after the other.
There is currently no support for this feature in any MySQL (afaik) driver. I've tried something with this. It works, but I think it is far from optimal. I currently split the input on ";" and then run each query individually. I also add any affectedRows and return it with the result.
I can think of many problem with this, on the top of my head :
I didn't spent too much time here because I want to know your opinion before going any further. I have also seen #258 but maybe we can work something out here ?
Thanks a lot, David