Expand handling of LIMIT 1, 2 handling to include sqlite (#1447)

This commit is contained in:
Joshua Warner 2024-09-30 10:40:07 -07:00 committed by GitHub
parent ce2686a169
commit 1e0460a7df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 61 additions and 24 deletions

View file

@ -67,7 +67,7 @@ use alloc::boxed::Box;
/// 1. user defined [`Dialect`]s can customize the parsing behavior
/// 2. The differences between dialects can be clearly documented in the trait
///
/// `dialect_of!(parser Is SQLiteDialect | GenericDialect)` evaluates
/// `dialect_of!(parser is SQLiteDialect | GenericDialect)` evaluates
/// to `true` if `parser.dialect` is one of the [`Dialect`]s specified.
macro_rules! dialect_of {
( $parsed_dialect: ident is $($dialect_type: ty)|+ ) => {
@ -323,6 +323,11 @@ pub trait Dialect: Debug + Any {
false
}
/// Does the dialect support parsing `LIMIT 1, 2` as `LIMIT 2 OFFSET 1`?
fn supports_limit_comma(&self) -> bool {
false
}
/// Does the dialect support trailing commas in the projection list?
fn supports_projection_trailing_commas(&self) -> bool {
self.supports_trailing_commas()