Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
==========================================
+ Coverage 84.31% 84.60% +0.28%
==========================================
Files 16 16
Lines 1556 1585 +29
==========================================
+ Hits 1312 1341 +29
Misses 141 141
Partials 103 103
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds execution-time support for MySQL/SingleStore DELIMITER directives and introduces an opt-in migration option to preserve SQL comments so comment-only statements can be executed (primarily for test coverage).
Changes:
- Add
libschema.PreserveComments()migration option and plumb it into SQL execution. - Update Postgres tests to preserve comments for comment-only migrations.
- Add MySQL and SingleStore integration tests covering delimiter-based stored procedure migrations.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
api.go |
Adds preserveComments flag + PreserveComments() option/accessor on migrations. |
internal/mhelp/run_sql.go |
Executes statements from token lists; now conditionally strips comments and strips leading/trailing delimiter directives. |
lspostgres/non_tx_test.go |
Updates comment-only migration test to use PreserveComments(). |
lspostgres/bad_test.go |
Updates RepeatUntilNoOp/comment-only migration case to use PreserveComments(). |
lsmysql/mysql_test.go |
Adds delimiter migration test + shared helper for delimiter-based migrations. |
lsmysql/singlestore_test.go |
Adds SingleStore wrapper test to reuse the MySQL delimiter helper. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Turns out that supporting delimiter goes beyond the change in sqltoken.