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.

Reading the nested columnsdoctest
$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) // => 1

Properties§

public list<JsonTableColumn> $columns

Methods§

public function __construct(public StringLiteral $path, list<JsonTableColumn> $columns)

Parameters

$pathStringLiteralThe path of the nested array
$columnslist<JsonTableColumn>The nested columns in order; at least one
Calls 2
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

$derivationDerivation
$environmentEnvironment

Returns

Test cases 1
Calls 4
public function render(Output $out): void

Writes the nested path and its columns.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 3§

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

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 1