Skip to content

Commit 0065fb1

Browse files
authored
fix: view with options (#288)
1 parent 76030b3 commit 0065fb1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

crates/pgt_statement_splitter/src/lib.rs

+10
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ mod tests {
154154
.expect_statements(vec!["select case when select 2 then 1 else 0 end"]);
155155
}
156156

157+
#[test]
158+
fn with_security_invoker() {
159+
Tester::from(
160+
"create view api.my_view with (security_invoker) as select id from public.my_table;",
161+
)
162+
.expect_statements(vec![
163+
"create view api.my_view with (security_invoker) as select id from public.my_table;",
164+
]);
165+
}
166+
157167
#[test]
158168
fn create_trigger() {
159169
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);

crates/pgt_statement_splitter/src/parser/ddl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use super::{Parser, common::unknown};
55
pub(crate) fn create(p: &mut Parser) {
66
p.expect(SyntaxKind::Create);
77

8-
unknown(p, &[]);
8+
unknown(p, &[SyntaxKind::With]);
99
}
1010

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

0 commit comments

Comments
 (0)