Skip to content

Commit a80454a

Browse files
committed
feat: Support prefixing array_agg with pg_catalog.
Signed-off-by: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com>
1 parent 459548f commit a80454a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/parser.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,17 @@ impl<'a> Parser<'a> {
496496
}
497497
}
498498

499-
if self.consume_token(&Token::LParen) {
499+
#[cfg(feature = "std")]
500+
let is_array_agg = dialect_of!(self is PostgreSqlDialect | GenericDialect)
501+
&& id_parts.len() == 2
502+
&& id_parts[0].value.eq_ignore_ascii_case("pg_catalog")
503+
&& id_parts[1].value.eq_ignore_ascii_case("array_agg");
504+
#[cfg(not(feature = "std"))]
505+
let is_array_agg = false;
506+
507+
if is_array_agg {
508+
self.parse_array_agg_expr()
509+
} else if self.consume_token(&Token::LParen) {
500510
self.prev_token();
501511
self.parse_function(ObjectName(id_parts))
502512
} else {

0 commit comments

Comments
 (0)