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

Derives the output fields of a select list.

Rule: MYSQL-STAR-001. An expression item is one field named by MYSQL-SELECT-ITEM-NAME-001. * contributes the columns the FROM clause selects (MYSQL-JOIN-COLUMNS-001: merged columns once); t.* contributes every column of the tables the qualifier names, merged ones included. A relation whose columns are not all known contributes its known columns and an open star that names the missing inputs; columns whose names depend on missing inputs (MYSQL-DERIVED-SHAPES-001) are known columns. An item whose name depends on missing inputs is a field without a name that names those inputs (OutputSlot::$unnamed). A star without any table and a qualifier that names no table are reported. Terminates: one pass over the list. Source: https://dev.mysql.com/doc/refman/8.4/en/select.html, https://dev.mysql.com/doc/refman/8.4/en/join.html. Status: Implemented.

Methods§

public function star(
    list<Field|OpenStar> $fields,
    Derivation $derivation,
    Environment $environment,
    JoinedInput $from,
): list<Field|OpenStar>
public function qualified(
    list<Field|OpenStar> $fields,
    Derivation $derivation,
    Environment $environment,
    QualifiedName $table,
): list<Field|OpenStar>

Appends every column of the relations a qualifier names.

Parameters

$fieldslist<Field|OpenStar>
$derivationDerivation
$environmentEnvironment
$tableQualifiedName

Returns

Called from 1
Calls 4
public function expand(
    list<Field|OpenStar> $fields,
    VisibleRelation $relation,
    bool $merged,
): list<Field|OpenStar>

Appends the columns of one relation, skipping the merged ones when asked, and an open star when its columns are not all known.

Parameters

$fieldslist<Field|OpenStar>
$relationVisibleRelation
$mergedbool

Returns

Called from 2
Calls 4
public function missing(list<VisibleRelation> $relations): list<MissingInput>

Collects the missing inputs of open relations.

Parameters

$relationslist<VisibleRelation>

Returns

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 3

Relations§

Instantiated in 4
Method calls 4