Skip to content

Commit cf9e504

Browse files
authored
Make GenericDialect support trailing commas in projections (#1921)
1 parent ed8757f commit cf9e504

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/dialect/generic.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ impl Dialect for GenericDialect {
116116
true
117117
}
118118

119+
fn supports_projection_trailing_commas(&self) -> bool {
120+
true
121+
}
122+
119123
fn supports_asc_desc_in_column_definition(&self) -> bool {
120124
true
121125
}

tests/sqlparser_common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11184,7 +11184,7 @@ fn parse_trailing_comma() {
1118411184
trailing_commas.verified_stmt(r#"SELECT "from" FROM "from""#);
1118511185

1118611186
// doesn't allow any trailing commas
11187-
let trailing_commas = TestedDialects::new(vec![Box::new(GenericDialect {})]);
11187+
let trailing_commas = TestedDialects::new(vec![Box::new(PostgreSqlDialect {})]);
1118811188

1118911189
assert_eq!(
1119011190
trailing_commas

0 commit comments

Comments
 (0)