Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/pgt_statement_splitter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,14 @@ values ('insert', new.id, now());",
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;"]);
}

#[test]
fn revoke_create() {
Tester::from("REVOKE CREATE ON SCHEMA public FROM introspector_postgres_user;")
.expect_statements(vec![
"REVOKE CREATE ON SCHEMA public FROM introspector_postgres_user;",
]);
}

#[test]
fn unknown() {
Tester::from("random stuff\n\nmore randomness\n\nselect 3").expect_statements(vec![
Expand Down
2 changes: 2 additions & 0 deletions crates/pgt_statement_splitter/src/splitter/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ pub(crate) fn unknown(p: &mut Splitter, exclude: &[SyntaxKind]) {
if [
// for grant
SyntaxKind::GRANT_KW,
// for revoke
SyntaxKind::REVOKE_KW,
SyntaxKind::COMMA,
]
.iter()
Expand Down