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

Derives the facts of INSERT and REPLACE.

Rule: MYSQL-INSERT-001. The written table is the one visible relation of the columns, the rows and the assignments; a value may refer to a column of the table (insert.html: a value may refer to a column set earlier in the row). The written columns are the column list, or every column of the table; they must be distinct. Each row of VALUES has one value per written column, except an empty row without a column list, which writes the defaults; rows also agree with each other, an empty row included. A query source is derived where the table is not visible and must return one column per written column. ON DUPLICATE KEY UPDATE assigns columns of the written table; its values see the written table, the row alias (MYSQL-DML-ROW-ALIAS-001), whose name may not be the table name, and, for a query source that is one query block without GROUP BY, the relations of its FROM clause. Generated columns take only DEFAULT (MYSQL-GENERATED-WRITE-001); a row or a query whose count does not match is reported for the count only, as the server stops there. A qualified star in a 5.x column list is reported as the server's unknown column '*'. Statements return no rows. Terminates: one pass over finite lists; the source query is derived once. Source: https://dev.mysql.com/doc/refman/8.4/en/insert.html, https://dev.mysql.com/doc/refman/8.4/en/insert-select.html, https://dev.mysql.com/doc/refman/8.4/en/insert-on-duplicate.html, https://dev.mysql.com/doc/refman/8.4/en/replace.html. Status: Implemented.

Methods§

public function column(
    list<Field>|null $written,
    int $position,
    VisibleRelation $target,
    ?Diagnostic $mismatch,
): Field

Answers the field a value at a position of a row is assigned to.

Parameters

$writtenlist<Field>|null
$positionint
$targetVisibleRelation
$mismatch?Diagnostic

Returns

Called from 1
Calls 6

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 3
Method calls 3