iffyio commented on code in PR #1991: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1991#discussion_r2251852918
########## src/parser/mod.rs: ########## @@ -15116,13 +15116,20 @@ impl<'a> Parser<'a> { } else { None }; + let limit = + if self.dialect.supports_update_delete_limit() && self.parse_keyword(Keyword::LIMIT) { + Some(self.parse_expr()?) + } else { + None + }; Review Comment: Since the syntax doesn't seem to conflict with other dialects, can we have the parser accept the clause if it shows up, avoiding the dialect method. e.g. ```rust let limit = self.maybe_parse(|p| { if p.parse_keyword(Keyword::LIMIT) { Some(self.parse_expr()?) } None })?; ``` ########## tests/sqlparser_sqlite.rs: ########## @@ -592,6 +593,41 @@ fn test_regexp_operator() { sqlite().verified_only_select(r#"SELECT count(*) FROM messages WHERE msg_text REGEXP '\d+'"#); } +#[test] +fn test_update_delete_limit() { Review Comment: hmm was there a requirement to use a test dialect here instead of `sqlite()` method? -- 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