Skip to content

Conversation

@muir
Copy link
Owner

@muir muir commented Nov 14, 2025

This had been internal. Making public. Includes Regroup() that groups statements together that can be part of the same migration.

@muir muir requested a review from dncohen November 14, 2025 23:16
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 89.42308% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.02%. Comparing base (2e91e34) to head (525df48).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
classifysql/classify.go 91.01% 10 Missing and 5 partials ⚠️
lspostgres/postgres.go 78.57% 2 Missing and 1 partial ⚠️
lsmysql/check.go 81.81% 1 Missing and 1 partial ⚠️
lsmysql/mysql.go 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #284      +/-   ##
==========================================
- Coverage   84.66%   84.02%   -0.64%     
==========================================
  Files          15       15              
  Lines        1343     1421      +78     
==========================================
+ Hits         1137     1194      +57     
- Misses        118      131      +13     
- Partials       88       96       +8     
Flag Coverage Δ
go_tests 23.08% <77.40%> (+2.45%) ⬆️
mysql_tests 48.61% <46.03%> (-2.07%) ⬇️
pg_tests 50.15% <33.66%> (-1.47%) ⬇️
singlestore_tests 45.77% <46.03%> (-1.90%) ⬇️

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.

@muir muir requested a review from suqin-haha November 17, 2025 18:52
Copy link
Collaborator

@dncohen dncohen left a comment

Choose a reason for hiding this comment

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

FYI, the title made me think the point was a Go interface. Maybe call this "introduce classifysql package" to be more explicit.

LGTM!

"regexp"
"strings"

"github.com/muir/sqltoken"
Copy link
Collaborator

Choose a reason for hiding this comment

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

just noticing "sql" is prefix in "sqltoken" and suffix in "classifysql". Should it be consistent? Should this package be simply "classify"?

type Dialect int

const (
DialectMySQL Dialect = iota
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't the zero be DialectGeneric or DialectUnknown?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I added a DialectInvalid as the zero.

@muir muir changed the title [feat] expose classifysql interface [feat] expose classifysql package Nov 20, 2025
@muir muir changed the title [feat] expose classifysql package [feat] introduce classifysql package Nov 20, 2025
@muir muir merged commit c413271 into main Nov 20, 2025
20 of 21 checks passed
@muir muir deleted the classifySQL branch November 20, 2025 23:51
IsDML: "DML",
IsNonIdempotent: "NonIdem",
IsMultipleStatements: "Multi",
IsEasilyIdempotentFix: "EasyFix",
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's cool repo,
This one I am not quite understand, are you going to do some special action to 'fix'/make it idempotent ( I didn't found the fix code yet) ?

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.

4 participants