iffyio commented on code in PR #2037:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2037#discussion_r2419465593


##########
src/parser/mod.rs:
##########
@@ -5605,14 +5609,24 @@ impl<'a> Parser<'a> {
             }
         }
 
-        self.expect_keyword_is(Keyword::FOR)?;
-        let include_each = self.parse_keyword(Keyword::EACH);
-        let trigger_object =
-            match self.expect_one_of_keywords(&[Keyword::ROW, 
Keyword::STATEMENT])? {
-                Keyword::ROW => TriggerObject::Row,
-                Keyword::STATEMENT => TriggerObject::Statement,
-                _ => unreachable!(),
-            };
+        let (include_each, trigger_object) = if 
self.parse_keyword(Keyword::FOR) {
+            (
+                self.parse_keyword(Keyword::EACH),
+                Some(
+                    match self.expect_one_of_keywords(&[Keyword::ROW, 
Keyword::STATEMENT])? {
+                        Keyword::ROW => TriggerObject::Row,
+                        Keyword::STATEMENT => TriggerObject::Statement,
+                        _ => unreachable!(),
+                    },
+                ),
+            )
+        } else {
+            if !dialect_of!(self is SQLiteDialect ) {
+                self.expect_keyword_is(Keyword::FOR)?;
+            }

Review Comment:
   @LucaCappelletti94 ah re the 
[comment](https://github.com/apache/datafusion-sqlparser-rs/pull/2037#issuecomment-3381061328)
 I think its to essentially do something like the following where the parser is 
more permissive
   ```rust
   } else {
       self.parse_keyword(Keyword::FOR)?;
   
       None
   };
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to