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

Lowers INSERT and REPLACE of every release.

Rule: MYSQL-INSERT-LOWERING-001. Scope: insert, replace, insert2, insert_table, table_name_with_opt_use_partition (5.6); insert_stmt, replace_stmt, opt_INTO (5.7 and later); insert_lock_option, replace_lock_option, opt_low_priority, opt_insert_update, opt_insert_update_list, opt_values_reference. The head becomes InsertInto; the source decides the statement class: rows of VALUES (InsertRows), SET assignments (InsertSet) or a query (InsertQuery). INTO is optional and has no meaning (DmlNoise). Terminates: the parts are strict subtrees. Source: https://dev.mysql.com/doc/refman/8.4/en/insert.html, https://dev.mysql.com/doc/refman/8.4/en/replace.html, https://dev.mysql.com/doc/refman/5.6/en/insert.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function target(Node $insert2): WriteTarget

Lowers the table of a node of insert2 (5.6).

Parameters

$insert2Node

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3
public function alias(Node $reference): ?RowAlias

Lowers a node of opt_values_reference; an absent alias is null.

Parameters

$referenceNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3

Private surface 3§

Implementation details, listed for orientation only.

private const LAYOUTS = ['insert_stmt: INSERT insert_lock_option opt_ignore opt_INTO table_ident opt_us…
private const PRIORITIES = ['insert_lock_option:' => null, 'insert_lock_option: LOW_PRIORITY' => \SqlSeman…
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