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

Lowers the actions of ALTER TABLE that are not column actions: keys, constraints, renames, conversion and options.

Rule: MYSQL-ALTER-ITEM-001. Scope: alter_list_item (with MYSQL-ALTER-COLUMN-001 for the column actions), opt_to. KEY and INDEX are synonyms; TO, AS, = and no word after RENAME are the same request; CHARACTER SET and CHARSET are synonyms. Keys, constraints and table options are lowered by the table definition family. Constructs: AddConstraint, DropElement, RenameElement, RenameTo, ToggleKeys, IndexVisibility, ConstraintEnforcement, ConvertCharset, SetTableOptions, Force, UpgradePartitioning, and the ALGORITHM and LOCK modifiers of 5.x through MYSQL-ALTER-MODIFIER-001. Terminates: constant work per action. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function named(Form $form, ElementKind $kind): AlterCommand
public function rename(Form $form): RenameTo
public function convert(Form $form): ConvertCharset

Private surface 5§

Implementation details, listed for orientation only.

private const DROPS = ['alter_list_item: DROP opt_column field_ident opt_restrict' => [\SqlSemantics\…
private const NAMED = ['alter_list_item: RENAME key_or_index field_ident TO_SYM field_ident' => \SqlS…
private const SIMPLE = ['alter_list_item: ADD key_def' => 'constraint', 'alter_list_item: ADD table_co…
private const TO = ['opt_to:' => true, 'opt_to: TO_SYM' => true, 'opt_to: EQ' => true, 'opt_to: AS…
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 1
Method calls 1