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

Lowers what INSERT and REPLACE write: the column list and the rows of VALUES or the query.

Rule: MYSQL-INSERT-SOURCE-LOWERING-001. Scope: insert_field_spec, insert_from_constructor, insert_from_subquery, insert_query_expression, insert_values, values_list, no_braces, row_value, value_or_values, fields, insert_ident, insert_columns, insert_column. A column list is ColumnList, also when it is empty; rows are InsertedRow; a query source is lowered by the query family, the 5.x forms through legacyQuery and legacyParenthesizedQuery. The answer is the column list with either the rows or the query. Terminates: lists are flattened by MYSQL-DML-LIST-001; the parts are strict subtrees. Source: https://dev.mysql.com/doc/refman/8.4/en/insert.html, https://dev.mysql.com/doc/refman/5.7/en/insert.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function body(Node $body): list<InsertedRow>|Query

Lowers rows or a query without a column list: a node of insert_values or insert_query_expression (5.7).

Parameters

$bodyNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 4
public function valued(Node $keyword, Node $list): list<InsertedRow>

Lowers the rows after the keyword VALUE or VALUES: a node of value_or_values and a node of values_list.

Parameters

$keywordNode
$listNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3
public function columns(Node $list): list<ColumnUse|TableWildcard>

Private surface 4§

Implementation details, listed for orientation only.

private const LISTED = ['insert_field_spec: insert_values' => null, 'insert_field_spec: ( ) insert_val…
private const COLUMN_LISTS = ['fields: fields , insert_ident', 'fields: insert_ident', 'insert_columns: inse…
private const ROW_LISTS = ['values_list: values_list , no_braces', 'values_list: no_braces', 'values_list…
private Lowering $lowering

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