classNestedColumns
final class NestedColumns
implements JsonTableColumn
uses Snapshot
Public API: explicitly declared with
@visibility public.A NESTED PATH path COLUMNS (...) column of JSON_TABLE: the columns of the rows of a nested array.
Rule: MYSQL-JSON-TABLE-COLUMN-001 (nested). The nested columns are part of the output of JSON_TABLE in written order; they are NULL in a row for which the nested path finds nothing. Terminates: the nested columns are strict parts. Source: https://dev.mysql.com/doc/refman/8.4/en/json-table-functions.html. Status: Implemented.
$nested = new \SqlSemantics\Platform\MySql\Statement\Call\Json\NestedColumns(new \SqlSemantics\Platform\MySql\Statement\Literal\StringLiteral(['$.b[*]']), [new \SqlSemantics\Platform\MySql\Statement\Call\Json\OrdinalityColumn(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('n'))]);
count($nested->columns) // => 1Properties§
public list<JsonTableColumn> $columnspublic StringLiteral $pathMethods§
public function __construct(public StringLiteral $path, list<JsonTableColumn> $columns)Parameters
$path | StringLiteral | The path of the nested array |
$columns | list<JsonTableColumn> | The nested columns in order; at least one |
Calls 2
- static-call Check::listOf() line 47
- class-const JsonTableColumn::class() line 47
public function deriveColumns(
Derivation $derivation,
Environment $environment,
): list<OutputSlot>Derives the path and the nested columns and answers their output, which can be NULL.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
list<OutputSlot>Test cases 1
Calls 4
- method-call Arguments::one() line 57
- new Arguments line 57
- new OutputSlot line 61
- class-const Nullability::Nullable() line 61
public function render(Output $out): voidWrites the nested path and its columns.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 73
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.