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
10 changes: 10 additions & 0 deletions crates/pgt_statement_splitter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ mod tests {
.expect_statements(vec!["select case when select 2 then 1 else 0 end"]);
}

#[test]
fn with_security_invoker() {
Tester::from(
"create view api.my_view with (security_invoker) as select id from public.my_table;",
)
.expect_statements(vec![
"create view api.my_view with (security_invoker) as select id from public.my_table;",
]);
}

#[test]
fn create_trigger() {
Tester::from("alter table appointment_status add constraint valid_key check (private.strip_special_chars(key) = key and length(key) > 0 and length(key) < 60);
Expand Down
2 changes: 1 addition & 1 deletion crates/pgt_statement_splitter/src/parser/ddl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::{Parser, common::unknown};
pub(crate) fn create(p: &mut Parser) {
p.expect(SyntaxKind::Create);

unknown(p, &[]);
unknown(p, &[SyntaxKind::With]);
}

pub(crate) fn alter(p: &mut Parser) {
Expand Down