Skip to content

Commit 26e53cc

Browse files
authored
Merge branch 'main' into fix-exclude-qualified-names
2 parents a640e27 + a3cfcac commit 26e53cc

12 files changed

Lines changed: 79 additions & 22 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ $ cargo run --features json_example --example cli FILENAME.sql [--dialectname]
159159

160160
## Users
161161

162-
This parser is currently being used by the [DataFusion] query engine, [LocustDB],
163-
[Ballista], [GlueSQL], [Opteryx], [Polars], [PRQL], [Qrlew], [JumpWire], [ParadeDB], [CipherStash Proxy],
164-
and [GreptimeDB].
162+
This parser is currently being used by the [DataFusion] query engine,
163+
[LocustDB], [Ballista], [GlueSQL], [Opteryx], [Polars], [PRQL], [Qrlew],
164+
[JumpWire], [ParadeDB], [CipherStash Proxy], [Readyset] and [GreptimeDB].
165165

166166
If your project is using sqlparser-rs feel free to make a PR to add it
167167
to this list.
@@ -282,3 +282,4 @@ licensed as above, without any additional terms or conditions.
282282
[`GenericDialect`]: https://docs.rs/sqlparser/latest/sqlparser/dialect/struct.GenericDialect.html
283283
[CipherStash Proxy]: https://github.com/cipherstash/proxy
284284
[GreptimeDB]: https://github.com/GreptimeTeam/greptimedb
285+
[Readyset]: https://github.com/readysettech/readyset

src/ast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ pub enum Expr {
11311131
/// ```sql
11321132
/// TRIM([BOTH | LEADING | TRAILING] [<expr> FROM] <expr>)
11331133
/// TRIM(<expr>)
1134-
/// TRIM(<expr>, [, characters]) -- only Snowflake or Bigquery
1134+
/// TRIM(<expr>, [, characters]) -- PostgreSQL, DuckDB, Snowflake, BigQuery, Generic
11351135
/// ```
11361136
Trim {
11371137
/// The expression to trim from.

src/dialect/bigquery.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,8 @@ impl Dialect for BigQueryDialect {
162162
fn supports_select_wildcard_replace(&self) -> bool {
163163
true
164164
}
165+
166+
fn supports_comma_separated_trim(&self) -> bool {
167+
true
168+
}
165169
}

src/dialect/clickhouse.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,8 @@ impl Dialect for ClickHouseDialect {
141141
fn supports_select_wildcard_replace(&self) -> bool {
142142
true
143143
}
144+
145+
fn supports_comma_separated_trim(&self) -> bool {
146+
true
147+
}
144148
}

src/dialect/duckdb.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,8 @@ impl Dialect for DuckDbDialect {
129129
fn supports_select_wildcard_replace(&self) -> bool {
130130
true
131131
}
132+
133+
fn supports_comma_separated_trim(&self) -> bool {
134+
true
135+
}
132136
}

src/dialect/generic.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,8 @@ impl Dialect for GenericDialect {
284284
fn supports_key_column_option(&self) -> bool {
285285
true
286286
}
287+
288+
fn supports_comma_separated_trim(&self) -> bool {
289+
true
290+
}
287291
}

src/dialect/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,12 @@ pub trait Dialect: Debug + Any {
16511651
fn supports_select_format(&self) -> bool {
16521652
false
16531653
}
1654+
1655+
/// Returns true if the dialect supports the two-argument comma-separated
1656+
/// form of the `TRIM` function: `TRIM(expr, characters)`.
1657+
fn supports_comma_separated_trim(&self) -> bool {
1658+
false
1659+
}
16541660
}
16551661

16561662
/// Operators for which precedence must be defined.

src/dialect/postgresql.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,4 +306,8 @@ impl Dialect for PostgreSqlDialect {
306306
fn supports_create_table_like_parenthesized(&self) -> bool {
307307
true
308308
}
309+
310+
fn supports_comma_separated_trim(&self) -> bool {
311+
true
312+
}
309313
}

src/dialect/snowflake.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,10 @@ impl Dialect for SnowflakeDialect {
667667
fn supports_lambda_functions(&self) -> bool {
668668
true
669669
}
670+
671+
fn supports_comma_separated_trim(&self) -> bool {
672+
true
673+
}
670674
}
671675

672676
// Peeks ahead to identify tokens that are expected after

src/dialect/sqlite.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,8 @@ impl Dialect for SQLiteDialect {
120120
fn supports_notnull_operator(&self) -> bool {
121121
true
122122
}
123+
124+
fn supports_comma_separated_trim(&self) -> bool {
125+
true
126+
}
123127
}

0 commit comments

Comments
 (0)