classJsonQueryRule
final class JsonQueryRule
Lowers the SQL/JSON query functions of PostgreSQL 17 and their clauses.
Rule: PG-JSON-QUERY-LOWERING-001. Scope: the JSON_QUERY, JSON_EXISTS and JSON_VALUE productions of func_expr_common_subexpr, json_passing_clause_opt, json_arguments, json_argument, json_wrapper_behavior, json_behavior, json_behavior_type, json_behavior_clause_opt, json_on_error_clause_opt, json_quotes_clause_opt. Constructors: the classes of Statement/Invocation/Json/Query. UNCONDITIONAL and ARRAY in the wrapper clause and ON SCALAR STRING in the quotes clause are noise (see InvocationNoise). Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/functions-json.html#FUNCTIONS-SQLJSON-QUERYING. Status: Implemented.
Methods§
public function function(Form $form): JsonQueryFunctionLowers a JSON_QUERY, JSON_EXISTS or JSON_VALUE production of func_expr_common_subexpr.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 10
- method-call Form::node() line 94
- method-call JsonQueryRule::passing() line 96
- new JsonQueryFunction line 99
- class-const JsonFunctionKind::Query() line 100
- method-call JsonQueryRule::wrapper() line 105
- method-call JsonQueryRule::quotes() line 106
- method-call JsonQueryRule::behaviors() line 107
- class-const JsonFunctionKind::Exists() line 110
- class-const JsonFunctionKind::Value() line 120
- static-call ImplementationGap::production() line 129
public function passing(Node $passing): list<JsonArgument>Lowers json_passing_clause_opt; no clause is an empty list.
Parameters
$passing | Node |
Returns
list<JsonArgument>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonPassing() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:155
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::function() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:96
Calls 3
- static-call ImplementationGap::production() line 147
- method-call Lowering::items() line 150
- new JsonArgument line 155
public function behaviors(Node $clause): ?JsonBehaviorClauseLowers json_behavior_clause_opt or json_on_error_clause_opt; no clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonBehavior() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:206
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::function() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:107
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::function() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:117
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::function() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:127
Calls 3
- new JsonBehaviorClause line 172
- method-call JsonQueryRule::behavior() line 172
- static-call ImplementationGap::production() line 175
public function behavior(Node $behavior): JsonBehaviorLowers json_behavior with its json_behavior_type.
Parameters
$behavior | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::behaviors() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:172
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::behaviors() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:173
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::behaviors() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:174
Calls 4
- new JsonBehavior line 188
- class-const JsonBehaviorKind::Default() line 188
- static-call ImplementationGap::production() line 191
- class-const JsonQueryRule::BEHAVIORS() line 195
public function wrapper(Node $wrapper): ?JsonWrappingLowers json_wrapper_behavior; no clause is null.
Parameters
$wrapper | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonWrapper() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:216
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::function() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:105
Calls 4
- function-call
array_key_existsline 206 - class-const JsonQueryRule::WRAPPERS() line 206
- static-call ImplementationGap::production() line 207
- new JsonWrapping line 211
public function quotes(Node $quotes): ?JsonQuotingLowers json_quotes_clause_opt; no clause is null.
Parameters
$quotes | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonQuotes() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:226
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::function() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:106
Calls 4
- function-call
array_key_existsline 222 - class-const JsonQueryRule::QUOTES() line 222
- static-call ImplementationGap::production() line 223
- new JsonQuoting line 227
Private surface 4§
Implementation details, listed for orientation only.
private const WRAPPERS = ['json_wrapper_behavior:' => null, 'json_wrapper_behavior: WITHOUT WRAPPER' => …private const QUOTES = ['json_quotes_clause_opt:' => null, 'json_quotes_clause_opt: KEEP QUOTES ON SCA…private const BEHAVIORS = ['json_behavior_type: ERROR_P' => \SqlSemantics\Platform\PostgreSql\Statement\I…private Lowering $loweringTest cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
Relations§
Instantiated in 5
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonPassing() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:155
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonBehavior() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:206
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonWrapper() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:216
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonQuotes() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:226
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule::subexpression() packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:94
Method calls 5
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonPassing() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:155
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonBehavior() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:206
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonWrapper() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:216
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations::jsonQuotes() packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:226
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule::subexpression() packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:94