Remove --with-tx flag (out of scope)#10
Merged
Merged
Conversation
MySQL auto-commits DDL, so wrapping plan/apply in BEGIN/COMMIT changes nothing meaningful. The flag was a documented no-op since day one and keeping it on the TODO as "implement or remove" was just deferring the decision. Remove it everywhere: - ApplyOptions.WithTx field gone from apply.go (kong won't surface --with-tx anymore). - TODO.md: drop both entries (the "implement properly" item under "Diff ordering and safety" and the "implement or remove" item under "Cleanup"). - AGENTS.md: drop the matching bullet from the "not yet implemented" list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## drop-trigger-routine-todos #10 +/- ##
===========================================================
Coverage 38.75% 38.75%
===========================================================
Files 20 20
Lines 1321 1321
===========================================================
Hits 512 512
Misses 702 702
Partials 107 107 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
winebarrel
added a commit
that referenced
this pull request
May 2, 2026
Two inline comments, both real edge-case bugs.
parser/directive.go
- tokenize() now also peels off everything from the first "(" in
non-backticked tokens. MySQL accepts `KEY idx(col)` (no space
between the index name and the column-list opener); previously
tokenize gave `idx(col)` as the name and the directive surfaced
as "target index not found". A bare token starting with "(" (the
`KEY (col)` unnamed form) collapses to empty and is dropped.
(Copilot #1.)
- classifyInlineLine: `CONSTRAINT <name> UNIQUE [KEY|INDEX] (...)`
defines a unique *index* in MySQL, renameable via ALTER TABLE …
RENAME INDEX. myschema models UNIQUE in t.Indexes. The
classifier now routes such lines to inlineKindIndex with the
constraint/index name, instead of mis-classifying as constraint
(which would surface as "constraint rename not supported").
Other CONSTRAINT shapes (CHECK, FOREIGN KEY, PRIMARY KEY) still
fall through to inlineKindConstraint. (Copilot #2.)
Tests
- parser/directive_test.go: TestExtractInlineRenamesNoSpaceIndexNameIsParsed
covers the no-space form for both `KEY` and `UNIQUE KEY`.
- parser/directive_test.go: TestExtractInlineRenamesConstraintUniqueIsIndex
covers `CONSTRAINT … UNIQUE KEY` and the no-keyword form
`CONSTRAINT … UNIQUE (…)`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Summary
MySQL auto-commits DDL, so wrapping plan/apply in BEGIN/COMMIT changes nothing meaningful. The flag has been a documented no-op since day one and keeping it on the TODO as "implement or remove" was just deferring the decision. Remove it everywhere.
ApplyOptions.WithTxfield gone fromapply.go(kong no longer surfaces--with-tx).TODO.md: drop both entries — the "implement properly" item under Diff ordering and safety and the "implement or remove" item under Cleanup.AGENTS.md: drop the matching bullet from the "not yet implemented" list.Note
Base branch is
drop-trigger-routine-todos(PR #9) so the AGENTS.md / TODO.md edits land cleanly on top of the trigger/routine cleanup. GitHub auto-rebases ontomainonce #9 merges.Test plan
go build ./...make test+make test-scenariogolangci-lintclean./myschema apply --help—--with-txno longer appears🤖 Generated with Claude Code