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.

Moving a table to another databasedoctest
$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 $table

Methods§

public function __construct(public QualifiedName $table)

Parameters

$tableQualifiedNameThe new name with its optional database
Calls 1
public function deriveCommand(Derivation $derivation, Environment $scope): void

Reports a new name another declared table already has.

Parameters

$derivationDerivation
$scopeEnvironment
Calls 6
public function render(Output $out): void

Writes the action.

Parameters

$outOutput
Calls 4

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
Type declarations 1