final class AlterDropColumn
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

A request to remove a column from a table.

Rule: SQLITE-ALTER-DROP-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, a name that is no column of it and the removal of its only column are diagnostics. The other reasons SQLite refuses a removal (a primary key, unique, indexed or referenced column) need constraints and indexes a declaration context does not hold. The optional COLUMN keyword is not written. The statement changes no declaration and provides none. Source: https://sqlite.org/lang_altertable.html#alter_table_drop_column. Status: Implemented.

Reading a column removaldoctest
$alter = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('ALTER TABLE t DROP COLUMN b');
    [$alter->statement->column->value, $alter->toString()] // => ['b', 'ALTER TABLE t DROP b']

Properties§

public QualifiedName $table
public Name $column

Methods§

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

Parameters

$tableQualifiedNameThe table to change
$columnNameThe column to remove
Calls 1
public function deriveStatement(Derivation $derivation): void

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

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 4

Test cases 3§

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 2

Relations§

Instantiated in 1