classAlterRenameTable
final class AlterRenameTable
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to rename a table.
Rule: SQLITE-ALTER-RENAME-TABLE-001. The resolution of the table is the relation fact of the statement node; a missing or conflicting table and a view (SQLITE-RELATION-KIND-001) are diagnostics. The new name is unqualified: the table stays in its schema. The statement changes no declaration and provides none. Source: https://sqlite.org/lang_altertable.html#alter_table_rename. Status: Implemented.
$alter = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('ALTER TABLE main.t RENAME TO u');
[$alter->statement->table->name->value, $alter->statement->newName->value, $alter->declarations()] // => ['t', 'u', []]Properties§
public QualifiedName $tablepublic Name $newNameMethods§
public function __construct(public QualifiedName $table, public Name $newName)Parameters
$table | QualifiedName | The table to rename |
$newName | Name | The new table name |
Calls 1
- static-call Check::input() line 45
public function deriveStatement(Derivation $derivation): voidRecords the resolution of the table.
Parameters
$derivation | Derivation |
Calls 6
- method-call RelationKinds::refuse() line 53
- new RelationKinds line 53
- method-call Derivation::target() line 53
- method-call TableShapes::target() line 53
- new TableShapes line 53
- class-const KindRefusal::RenameTable() line 53
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 61
- method-call ObjectNames::write() line 62
- new ObjectNames line 62
- class-const NameUse::Relation() line 63
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.