mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-23 23:44:07 +00:00
json_object('k' VALUE 'v')
in postgres (#1547)
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
This commit is contained in:
parent
b0007389dc
commit
96f7c0277a
3 changed files with 19 additions and 0 deletions
|
@ -2824,6 +2824,19 @@ fn test_json() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_fn_arg_with_value_operator() {
|
||||
match pg().verified_expr("JSON_OBJECT('name' VALUE 'value')") {
|
||||
Expr::Function(Function { args: FunctionArguments::List(FunctionArgumentList { args, .. }), .. }) => {
|
||||
assert!(matches!(
|
||||
&args[..],
|
||||
&[FunctionArg::ExprNamed { operator: FunctionArgOperator::Value, .. }]
|
||||
), "Invalid function argument: {:?}", args);
|
||||
}
|
||||
other => panic!("Expected: JSON_OBJECT('name' VALUE 'value') to be parsed as a function, but got {other:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_json_table_is_not_reserved() {
|
||||
// JSON_TABLE is not a reserved keyword in PostgreSQL, even though it is in SQL:2023
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue