File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
crates/pg_statement_splitter/src/parser Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -124,10 +124,23 @@ pub(crate) fn unknown(p: &mut Parser, exclude: &[SyntaxKind]) {
124124 }
125125 t => match at_statement_start ( t. kind , exclude) {
126126 Some ( SyntaxKind :: Select ) => {
127- // we need to check for `as` here to not break on `select as`
128- if p. look_back ( ) . map ( |t| t. kind ) != Some ( SyntaxKind :: As ) {
127+ let prev = p. look_back ( ) . map ( |t| t. kind ) ;
128+ if [
129+ // for create view / table as
130+ SyntaxKind :: As ,
131+ // for create rule
132+ SyntaxKind :: On ,
133+ // for create rule
134+ SyntaxKind :: Also ,
135+ // for create rule
136+ SyntaxKind :: Instead ,
137+ ]
138+ . iter ( )
139+ . all ( |x| Some ( x) != prev. as_ref ( ) )
140+ {
129141 break ;
130142 }
143+
131144 p. advance ( ) ;
132145 }
133146 Some ( SyntaxKind :: Insert ) | Some ( SyntaxKind :: Update ) | Some ( SyntaxKind :: DeleteP ) => {
You can’t perform that action at this time.
0 commit comments