Op 7/17/23 om 07:00 schreef jian he:
hi.
seems there is no explanation about, json_api_common_syntax in
functions-json.html
I can get json_query full synopsis from functions-json.html as follows:
json_query ( context_item, path_expression [ PASSING { value AS
varname } [, ...]] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8
] ] ] [ { WITHOUT | WITH { CONDITIONAL | [UNCONDITIONAL] } } [ ARRAY ]
WRAPPER ] [ { KEEP | OMIT } QUOTES [ ON SCALAR STRING ] ] [ { ERROR |
NULL | EMPTY { [ ARRAY ] | OBJECT } | DEFAULT expression } ON EMPTY ]
[ { ERROR | NULL | EMPTY { [ ARRAY ] | OBJECT } | DEFAULT expression }
ON ERROR ])
seems doesn't have a full synopsis for json_table? only partial one
by one explanation.
FWIW, Re: json_api_common_syntax
An (old) pdf that I have (ISO/IEC TR 19075-6 First edition 2017-03)
contains the below specification. It's probably the source of the
particular term. It's easy to see how it maps onto the current v7
SQL/JSON implementation. (I don't know if it has changed in later
incarnations.)
------ 8< ------------
5.2 JSON API common syntax
The SQL/JSON query functions all need a path specification, the JSON
value to be input to that path specification for querying and
processing, and optional parameter values passed to the path
specification. They use a common syntax:
<JSON API common syntax> ::=
<JSON context item> <comma> <JSON path specification>
[ AS <JSON table path name> ]
[ <JSON passing clause> ]
<JSON context item> ::=
<JSON value expression>
<JSON path specification> ::=
<character string literal>
<JSON passing clause> ::=
PASSING <JSON argument> [ { <comma> <JSON argument> } ]
<JSON argument> ::=
<JSON value expression> AS <identifier>
------ 8< ------------
And yes, we might need a readable translation of that in the docs
although it might be easier to just get get rid of the term
'json_api_common_syntax'.
HTH,
Erik Rijkers