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

Derives the columns an INSERT column list or a SET list writes, and the values assigned to them.

Rule: PG-ASSIGNMENT-001. A written name is a column of the target table, never a qualifier; a name the table certainly lacks is reported, a system column cannot be written, and a step .* is reported. A column written whole may not be written again, whole or in part, in the same list; parts of one column (different subscripts or fields) may. The subscripts of the steps see the environment of the values. A value is derived in the environment of the clause and must convert to the column type (PG-ASSIGNMENT-CAST-001) when the whole column is written; DEFAULT takes the column default, also in parentheses, which the grammar drops. A multiple-column item takes its values from a row constructor, whose fields may be DEFAULT, or from a scalar subquery, with as many values as columns; any other source is reported. A generated column takes DEFAULT only (PG-GENERATED-WRITE-001). Termination: one pass over the items. Source: https://www.postgresql.org/docs/17/sql-insert.html, https://www.postgresql.org/docs/17/sql-update.html. Status: Implemented.

Methods§

public function columns(
    list<ColumnTarget> $columns,
    VisibleRelation $target,
    Derivation $derivation,
    Environment $environment,
    ManipulationMisuseRule $repeated,
): list<OutputSlot|null>
public function slot(
    ColumnTarget $column,
    VisibleRelation $target,
    Derivation $derivation,
): ?OutputSlot
public function row(
    RowAssignment $assignment,
    list<OutputSlot|null> $slots,
    Derivation $derivation,
    Environment $environment,
): void
public function types(
    RowConstructor|ScalarSubquery $source,
    TypeFact $type,
): list<TypeFact|null>|null

Answers the types of the values a multiple-column source supplies, null for one not to check, or null when they are not known.

A field of a row constructor that is DEFAULT, or whose type the row reports as text (as it does for a string constant), is not checked. A subquery of several columns yields an anonymous record of them; a subquery of one column yields its value.

Returns

list<TypeFact|null>|null
Called from 1
Calls 2

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 9
Method calls 16