Skip to content

[fix] support delimiter#331

Merged
muir merged 8 commits intomainfrom
supportDelimiter
Mar 9, 2026
Merged

[fix] support delimiter#331
muir merged 8 commits intomainfrom
supportDelimiter

Conversation

@muir
Copy link
Owner

@muir muir commented Mar 4, 2026

Turns out that supporting delimiter goes beyond the change in sqltoken.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.60%. Comparing base (152db66) to head (18f1f2d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lspostgres/postgres.go 66.66% 0 Missing and 1 partial ⚠️
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              
Flag Coverage Δ
go_tests 20.75% <0.00%> (-0.39%) ⬇️
mysql_tests 49.71% <83.33%> (+1.01%) ⬆️
pg_tests 53.99% <27.77%> (-0.62%) ⬇️
singlestore_tests 46.59% <83.33%> (+1.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

@muir muir force-pushed the supportDelimiter branch from 94b9563 to ea6946d Compare March 9, 2026 22:59
@muir muir temporarily deployed to singlestore March 9, 2026 22:59 — with GitHub Actions Inactive
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

@muir muir temporarily deployed to singlestore March 9, 2026 23:07 — with GitHub Actions Inactive
@muir muir temporarily deployed to singlestore March 9, 2026 23:11 — with GitHub Actions Inactive
@muir muir merged commit 57d2d27 into main Mar 9, 2026
19 checks passed
@muir muir deleted the supportDelimiter branch March 9, 2026 23:18
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.

2 participants