classAlterRenameColumn
final class AlterRenameColumn
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to rename a column of a table.
Rule: SQLITE-ALTER-RENAME-COLUMN-001. The resolution of the table is the relation fact of the statement node. When the column list of the table is completely known, an old name that is no column of it and a new name that another column already has are diagnostics. The optional COLUMN keyword is not written. The statement changes no declaration and provides none. Source: https://sqlite.org/lang_altertable.html#alter_table_rename_column. Status: Implemented.
$alter = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('ALTER TABLE t RENAME COLUMN a TO b');
[$alter->statement->column->value, $alter->statement->newName->value, $alter->toString()] // => ['a', 'b', 'ALTER TABLE t RENAME a TO b']Properties§
public QualifiedName $tablepublic Name $columnpublic Name $newNameMethods§
public function __construct(
public QualifiedName $table,
public Name $column,
public Name $newName,
)Parameters
$table | QualifiedName | The table to change |
$column | Name | The column to rename |
$newName | Name | The new column name |
Calls 1
- static-call Check::input() line 48
public function deriveStatement(Derivation $derivation): voidRecords the resolution of the table and reports a rename the declared columns rule out.
Parameters
$derivation | Derivation |
Calls 8
- method-call Derivation::target() line 56
- method-call TableShapes::target() line 56
- new TableShapes line 56
- method-call RelationKinds::refuse() line 57
- new RelationKinds line 57
- class-const KindRefusal::RenameColumn() line 57
- method-call AlterationProblems::renamed() line 58
- new AlterationProblems line 58
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 67
- method-call ObjectNames::write() line 68
- new ObjectNames line 68
- class-const NameUse::Column() line 69
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.