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.

Reading a column renamedoctest
$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 $table
public Name $column
public Name $newName

Methods§

public function __construct(
    public QualifiedName $table,
    public Name $column,
    public Name $newName,
)

Parameters

$tableQualifiedNameThe table to change
$columnNameThe column to rename
$newNameNameThe new column name
Calls 1
public function deriveStatement(Derivation $derivation): void

Records the resolution of the table and reports a rename the declared columns rule out.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 4

Test cases 2§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 1