Skip to content

Parser: Share foreign-key reference clause parsing - #2715

Merged
alamb merged 1 commit into
mainfrom
refactor-reference-clauses
Oct 26, 2026
Merged

alamb merged 1 commit into
mainfrom
refactor-reference-clauses

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

Column-level REFERENCES and table-level FOREIGN KEY constraints accept the same MATCH, ON DELETE, and ON UPDATE clauses. A shared parser keeps clause ordering and duplicate handling consistent.

Addresses the reference-clause duplication tracked in #2698.

Found with cargo-echoes

@LucaCappelletti94 LucaCappelletti94 added the deduplication Removal of duplicated code label Oct 25, 2026
@github-actions

Copy link
Copy Markdown

No dialect label was applied because the title does not name a SQL dialect.

If this change targets one or more dialects, edit the title to <Dialect>[, <Dialect>]: <description>, add a Dialects: <Dialect>[, <Dialect>] line to the description, or reply with one. Reply Dialects: none if the change is dialect-agnostic.

@codecov-commenter

codecov-commenter commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.26%. Comparing base (e997a09) to head (09f3ffa).

Files with missing lines Patch % Lines
src/parser/mod.rs 80.00% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2715   +/-   ##
=======================================
  Coverage   82.26%   82.26%           
=======================================
  Files          42       42           
  Lines       35303    35304    +1     
  Branches    35303    35304    +1     
=======================================
+ Hits        29041    29044    +3     
+ Misses       2698     2697    -1     
+ Partials     3564     3563    -1     

☔ View full report in Codecov by Harness.
📢 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.

@LucaCappelletti94
LucaCappelletti94 added this pull request to the merge queue Oct 26, 2026
@LucaCappelletti94

Copy link
Copy Markdown
Contributor Author

Merging also this as it is a cleanup.

cc @alamb

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 26, 2026
@LucaCappelletti94
LucaCappelletti94 force-pushed the refactor-reference-clauses branch from 353d4d6 to 09f3ffa Compare October 26, 2026 17:07
@alamb
alamb added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 49033b0 Oct 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deduplication Removal of duplicated code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants