Skip to content

Remove --with-tx flag (out of scope)#10

Merged
winebarrel merged 1 commit into
drop-trigger-routine-todosfrom
drop-with-tx
May 2, 2026
Merged

Remove --with-tx flag (out of scope)#10
winebarrel merged 1 commit into
drop-trigger-routine-todosfrom
drop-with-tx

Conversation

@winebarrel

Copy link
Copy Markdown
Owner

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.WithTx field gone from apply.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 onto main once #9 merges.

Test plan

  • go build ./...
  • make test + make test-scenario
  • golangci-lint clean
  • ./myschema apply --help--with-tx no longer appears

🤖 Generated with Claude Code

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

codecov Bot commented May 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.75%. Comparing base (cd8beff) to head (b1c892c).
⚠️ Report is 2 commits behind head on drop-trigger-routine-todos.

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.
📢 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.

@winebarrel winebarrel merged commit 3980a49 into drop-trigger-routine-todos May 2, 2026
4 checks passed
@winebarrel winebarrel deleted the drop-with-tx branch May 2, 2026 02:54
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>
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.

1 participant