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


##########
src/dialect/mssql.rs:
##########
@@ -215,6 +218,78 @@ impl MsSqlDialect {
         }))
     }
 
+    /// Parse a SQL CREATE statement
+    fn parse_create(&self, parser: &mut Parser) -> Option<Result<Statement, 
ParserError>> {
+        let original_index = parser.index();
+
+        if !parser.parse_keyword(Keyword::CREATE) {
+            parser.set_index(original_index);

Review Comment:
   Ah yes you're right, if failure occurs while parsing the trigger body for 
example the ideal behavior in this case would be to report that error instead 
of returning None. In which case maybe_parse isn't ideal.
   
   I think the main goal is avoiding a custom implementation to track indexing 
here, looking at the new diff it seems the  sqlserver version is simpler so 
maybe something like this suffices already?
   ```rust
   if self.parse_keywords(CREATE, TRIGGER) {
     Some(self.parse_create_trigger(self, parser, false))
   } else if self.parse_keywords(CREATE, OR, ALTER, TRIGGER) {
     Some(self.parse_create_trigger(self, parser, true))
   } else {
     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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to