support json_object('k':'v') in postgres (#1546)

This commit is contained in:
Ophir LOJKINE 2024-11-25 22:01:23 +01:00 committed by GitHub
parent fd21fae297
commit 525d1780e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 191 additions and 160 deletions

View file

@ -211,6 +211,26 @@ impl Dialect for PostgreSqlDialect {
fn supports_load_extension(&self) -> bool {
true
}
/// See <https://www.postgresql.org/docs/current/functions-json.html>
///
/// Required to support the colon in:
/// ```sql
/// SELECT json_object('a': 'b')
/// ```
fn supports_named_fn_args_with_colon_operator(&self) -> bool {
true
}
/// See <https://www.postgresql.org/docs/current/functions-json.html>
///
/// Required to support the label in:
/// ```sql
/// SELECT json_object('label': 'value')
/// ```
fn supports_named_fn_args_with_expr_name(&self) -> bool {
true
}
}
pub fn parse_create(parser: &mut Parser) -> Option<Result<Statement, ParserError>> {