From cf9e50474ec6c59027bcc3e2f418c5ff6947920a Mon Sep 17 00:00:00 2001 From: Simon Vandel Sillesen Date: Sun, 6 Jul 2025 08:57:20 +0200 Subject: [PATCH] Make `GenericDialect` support trailing commas in projections (#1921) --- src/dialect/generic.rs | 4 ++++ tests/sqlparser_common.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dialect/generic.rs b/src/dialect/generic.rs index 59671e21..5e9f2e4e 100644 --- a/src/dialect/generic.rs +++ b/src/dialect/generic.rs @@ -116,6 +116,10 @@ impl Dialect for GenericDialect { true } + fn supports_projection_trailing_commas(&self) -> bool { + true + } + fn supports_asc_desc_in_column_definition(&self) -> bool { true } diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs index ed9bb704..56b015fc 100644 --- a/tests/sqlparser_common.rs +++ b/tests/sqlparser_common.rs @@ -11184,7 +11184,7 @@ fn parse_trailing_comma() { trailing_commas.verified_stmt(r#"SELECT "from" FROM "from""#); // doesn't allow any trailing commas - let trailing_commas = TestedDialects::new(vec![Box::new(GenericDialect {})]); + let trailing_commas = TestedDialects::new(vec![Box::new(PostgreSqlDialect {})]); assert_eq!( trailing_commas