classAlterRule
final class AlterRule
Lowers ALTER TABLE: the statement and the lists that hold its actions.
Rule: MYSQL-ALTER-STATEMENT-001. Scope: the ALTER TABLE alternatives of alter (5.6, 5.7), alter_table_stmt, alter_commands, alter_command_list, opt_alter_table_actions, standalone_alter_table_action, alter_table_partition_options, opt_alter_command_list, alter_list, remove_partitioning. The actions are flattened into one list in the order written; a run of table options written without commas is one action. Constructs: AlterTable, SetTableOptions, PartitionBy, RemovePartitioning. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function statement(Form $form): AlterTableLowers ALTER TABLE: a production of alter routed to this family, or a node of alter_table_stmt.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- new AlterTable line 87
- method-call Form::node() line 88
- method-call AlterRule::commands() line 89
- static-call ImplementationGap::production() line 98
public function commands(Node $node): list<AlterCommand>Lowers the actions a node holds, in the order written.
Parameters
$node | Node |
Returns
list<AlterCommand>Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:89
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::statement() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:96
- method-call SqlSemantics\Platform\MySql\Lowering\TableChange\Alter\AlterRule::commands() packages/sql-semantics-mysql/src/Lowering/TableChange/Alter/AlterRule.php:114
Calls 10
- method-call Lowering::form() line 110
- class-const AlterRule::PARTS() line 111
- method-call AlterRule::commands() line 114
- new StandaloneRule line 119
- method-call StandaloneRule::claims() line 120
- method-call StandaloneRule::command() line 121
- class-const AlterRule::REMOVALS() line 123
- function-call
countline 124 - new RemovePartitioning line 128
- method-call AlterRule::others() line 131
public function others(Form $form): list<AlterCommand>Lowers the action lists that are not a sequence of parts: the list spine, modifiers and partitioning.
Parameters
$form | Form |
Returns
list<AlterCommand>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 9
- class-const AlterRule::LISTS() line 142
- method-call AlterRule::items() line 143
- method-call ModifierRule::modifiers() line 146
- new ModifierRule line 146
- method-call Form::node() line 149
- static-call ImplementationGap::production() line 152
- method-call PartitionRule::partitioning() line 154
- new PartitionRule line 154
- new PartitionBy line 156
public function items(Node $list): list<AlterCommand>Lowers the items of the action list spine: actions, modifiers and runs of table options.
Parameters
$list | Node |
Returns
list<AlterCommand>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 7
- method-call Lists::items() line 168
- new Lists line 168
- method-call ItemRule::item() line 170
- new ItemRule line 170
- method-call ModifierRule::modifier() line 171
- new ModifierRule line 171
- new SetTableOptions line 172
Private surface 4§
Implementation details, listed for orientation only.
private const PARTS = ['alter_commands:' => [], 'alter_command_list:' => [], 'opt_alter_command_list:…private const LISTS = ['alter_list: alter_list_item' => true, 'alter_list: alter_list , alter_list_it…private const REMOVALS = ['remove_partitioning: REMOVE_SYM PARTITIONING_SYM have_partitioning' => true, …private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
AlterRuleTestcalls