classRenameTo
final class RenameTo
implements AlterCommand
uses Snapshot
Public API: explicitly declared with
@visibility public.RENAME [TO | AS] new: a request to rename the table, possibly into another database.
Mirrors PT_alter_table_rename. A new name the context declares is the diagnostic TableExists, unless it is the name of the changed table itself. TO, AS, = and no word are the same request; TO is written. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html#alter-table-rename.
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER TABLE t RENAME AS archive.t');
$alter->toString() // => 'ALTER TABLE t RENAME TO archive.t'Properties§
public QualifiedName $tableMethods§
public function __construct(public QualifiedName $table)Parameters
$table | QualifiedName | The new name with its optional database |
Calls 1
- static-call Check::input() line 42
public function deriveCommand(Derivation $derivation, Environment $scope): voidReports a new name another declared table already has.
Parameters
$derivation | Derivation | |
$scope | Environment |
Calls 6
- method-call Derivation::table() line 50
- method-call Derivation::environment() line 50
- method-call Targets::same() line 52
- new Targets line 52
- method-call Derivation::report() line 54
- new TableExists line 54
public function render(Output $out): voidWrites the action.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 63
- method-call Output::name() line 65
- class-const NameUse::Qualifier() line 65
- class-const NameUse::Relation() line 67
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
RenameToTestcalls