Skip to content

Commit 8b03000

Browse files
authored
fix: revoke create splitter (#505)
#135 (comment)
1 parent dd6a23f commit 8b03000

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

crates/pgt_statement_splitter/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,14 @@ values ('insert', new.id, now());",
477477
Tester::from("insert into table (col) select 1 from other t cross join lateral jsonb_array_elements(t.buttons) with ordinality as a(b, nr) where t.buttons is not null;").expect_statements(vec!["insert into table (col) select 1 from other t cross join lateral jsonb_array_elements(t.buttons) with ordinality as a(b, nr) where t.buttons is not null;"]);
478478
}
479479

480+
#[test]
481+
fn revoke_create() {
482+
Tester::from("REVOKE CREATE ON SCHEMA public FROM introspector_postgres_user;")
483+
.expect_statements(vec![
484+
"REVOKE CREATE ON SCHEMA public FROM introspector_postgres_user;",
485+
]);
486+
}
487+
480488
#[test]
481489
fn unknown() {
482490
Tester::from("random stuff\n\nmore randomness\n\nselect 3").expect_statements(vec![

crates/pgt_statement_splitter/src/splitter/common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ pub(crate) fn unknown(p: &mut Splitter, exclude: &[SyntaxKind]) {
261261
if [
262262
// for grant
263263
SyntaxKind::GRANT_KW,
264+
// for revoke
265+
SyntaxKind::REVOKE_KW,
264266
SyntaxKind::COMMA,
265267
]
266268
.iter()

0 commit comments

Comments
 (0)