Skip to content

Commit 62b12e7

Browse files
committed
2 parents a6a8f07 + b45c30e commit 62b12e7

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

src/dialect/bigquery.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ impl Dialect for BigQueryDialect {
115115
true
116116
}
117117

118+
// See <https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#group_by_clause>
119+
fn supports_group_by_expr(&self) -> bool {
120+
true
121+
}
122+
118123
fn is_column_alias(&self, kw: &Keyword, _parser: &mut Parser) -> bool {
119124
!RESERVED_FOR_COLUMN_ALIAS.contains(kw)
120125
}

src/dialect/generic.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,8 @@ impl Dialect for GenericDialect {
147147
fn supports_array_typedef_size(&self) -> bool {
148148
true
149149
}
150+
151+
fn supports_match_against(&self) -> bool {
152+
true
153+
}
150154
}

src/dialect/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,11 @@ pub trait Dialect: Debug + Any {
479479
false
480480
}
481481

482+
/// Does the dialect support the `MATCH() AGAINST()` syntax?
483+
fn supports_match_against(&self) -> bool {
484+
false
485+
}
486+
482487
/// Dialect-specific infix parser override
483488
///
484489
/// This method is called to parse the next infix expression.

src/dialect/mysql.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ impl Dialect for MySqlDialect {
129129
fn requires_single_line_comment_whitespace(&self) -> bool {
130130
true
131131
}
132+
133+
fn supports_match_against(&self) -> bool {
134+
true
135+
}
132136
}
133137

134138
/// `LOCK TABLES`

src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ impl<'a> Parser<'a> {
11981198
})))
11991199
}
12001200
Keyword::NOT => Ok(Some(self.parse_not()?)),
1201-
Keyword::MATCH if dialect_of!(self is MySqlDialect | GenericDialect) => {
1201+
Keyword::MATCH if self.dialect.supports_match_against() => {
12021202
Ok(Some(self.parse_match_against()?))
12031203
}
12041204
Keyword::STRUCT if self.dialect.supports_struct_literal() => {

0 commit comments

Comments
 (0)