final class JsonRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Lowers JSON_VALUE and the COLUMNS clause of JSON_TABLE with their ON EMPTY and ON ERROR responses.

Rule: MYSQL-CALL-JSON-001. Scope: the JSON_VALUE alternative of function_call_keyword, opt_returning_type, opt_on_empty_or_error, opt_on_empty_or_error_json_table, on_empty, on_error, json_on_response, columns_clause, columns_list, jt_column, jt_column_type. A JSON_TABLE column may write ON ERROR before ON EMPTY; the order is kept. Constructs: JsonValueCall, JsonResponse, OrdinalityColumn, PathColumn, NestedColumns. Terminates: the column list is flattened in a loop; a nested COLUMNS clause is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/json-search-functions.html#function_json-value, https://dev.mysql.com/doc/refman/8.4/en/json-table-functions.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function returning(Node $clause): ?CastTarget

Lowers the optional RETURNING type: a node of opt_returning_type.

Parameters

$clauseNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 2
public function responses(Node $clause): array{JsonResponse|null, JsonResponse|null}

Private surface 1§

Implementation details, listed for orientation only.

private Lowering $lowering

Test cases 7§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 7

Relations§

Instantiated in 2
Method calls 2