Repository navigation
Add support for PostgreSQL DROP RULE - #2434
Open
LucaCappelletti94 wants to merge 5 commits into
Open
LucaCappelletti94 wants to merge 5 commits into
LucaCappelletti94 wants to merge 5 commits into
Conversation
LucaCappelletti94
marked this pull request as ready for review
August 7, 2026 07:29
LucaCappelletti94
force-pushed
the
pg-drop-rule
branch
4 times, most recently
from
September 22, 2026 21:03
ac7a7bd to
8cf512e
Compare
LucaCappelletti94
added a commit
to LucaCappelletti94/sqlparser-rs
that referenced
this pull request
Oct 1, 2026
LucaCappelletti94
force-pushed
the
pg-drop-rule
branch
from
October 2, 2026 16:15
defd2dd to
5285729
Compare
sabir-akhadov-localstack
approved these changes
Oct 20, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2434 +/- ##
==========================================
+ Coverage 81.99% 82.02% +0.02%
==========================================
Files 42 42
Lines 35049 35082 +33
Branches 35049 35082 +33
==========================================
+ Hits 28740 28776 +36
+ Misses 2744 2741 -3
Partials 3565 3565 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
pg-drop-rule
branch
from
October 21, 2026 07:55
a37340d to
2071d91
Compare
s5dsn-eqee
suggested changes
Oct 23, 2026
Contributor
There was a problem hiding this comment.
Like it, Span especially
Could you add a few more red tests, e.g.:
#[test]
fn parse_drop_rule_rejects_lists_and_extra_options() {
for (sql, expected) in [
("DROP RULE r1, r2 ON t", "Expected: ON, found: ,"),
("DROP RULE s.r ON t", "Expected: ON, found: ."),
("DROP RULE 1 ON t", "Expected: identifier, found: 1"),
("DROP RULE IF EXISTS", "Expected: identifier, found: EOF"),
("DROP RULE IF NOT EXISTS r ON t", "Expected: ON, found: NOT"),
("DROP RULE r t", "Expected: ON, found: t"),
("DROP RULE r ON (t)", "Expected: identifier, found: ("),
("DROP RULE r ON t1, t2", "Expected: end of statement, found: ,"),
("DROP RULE r ON t ON t", "Expected: end of statement, found: ON"),
("DROP RULE r ON t CASCADE RESTRICT", "Expected: end of statement, found: RESTRICT"),
("DROP RULE r ON t RESTRICT CASCADE", "Expected: end of statement, found: CASCADE"),
("DROP RULE r ON t PURGE", "Expected: end of statement, found: PURGE"),
] {
let err = all_dialects().parse_sql_statements(sql).unwrap_err().to_string();
assert!(err.starts_with(&format!("sql parser error: {expected}")), "{sql}: {err}");
}
}| } | ||
| } | ||
|
|
||
| impl Spanned for DropRule { |
LucaCappelletti94
force-pushed
the
pg-drop-rule
branch
2 times, most recently
from
October 24, 2026 13:41
b8f3ced to
6994dd5
Compare
LucaCappelletti94
force-pushed
the
pg-drop-rule
branch
from
October 24, 2026 14:32
6994dd5 to
9c43025
Compare
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.
The parser does not recognize
DROP RULE, so migration scripts and schema dumps that remove rewrite rules fail to parse. This is the companion of #2433, and the two are independent and can land in either order.Doc: https://www.postgresql.org/docs/current/sql-droprule.html