aharpervc commented on code in PR #1810: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1810#discussion_r2067364403
########## src/parser/mod.rs: ########## @@ -5256,14 +5256,19 @@ impl<'a> Parser<'a> { pub fn parse_create_trigger( &mut self, + or_alter: bool, or_replace: bool, is_constraint: bool, ) -> Result<Statement, ParserError> { - if !dialect_of!(self is PostgreSqlDialect | GenericDialect | MySqlDialect) { + if !dialect_of!(self is PostgreSqlDialect | GenericDialect | MySqlDialect | MsSqlDialect) { self.prev_token(); return self.expected("an object type after CREATE", self.peek_token()); } + if dialect_of!(self is MsSqlDialect) { + return self.parse_mssql_create_trigger(or_alter, or_replace, is_constraint); + } Review Comment: Okay, thanks for the reference. The patterns in this library are difficult to interpret sometimes (what's best practice vs what's deprecated). I've moved the trigger parsing logic into the dialect. Doing it this way also means we need to be able to rewind the parser if it's some form of "create" not handled particularly in the dialect, so I also added a parser method to reset the index in that case accordingly. -- 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