final class ColumnAction
    implements AlterCommand
    uses Snapshot
Public API: explicitly declared with @visibility public.

An action on a column without an operand: SET/DROP NOT NULL, DROP DEFAULT, DROP EXPRESSION, DROP IDENTITY.

Mirrors AT_SetNotNull, AT_DropNotNull, AT_ColumnDefault without a default, AT_DropExpression and AT_DropIdentity (with missing_ok for IF EXISTS). The optional COLUMN word is not kept. Source: https://www.postgresql.org/docs/17/sql-altertable.html.

Reading a column actiondoctest
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t ALTER COLUMN a DROP NOT NULL');
    $statement->statement->commands[0]->kind // => \SqlSemantics\Platform\PostgreSql\Statement\Table\Alter\Column\ColumnActionKind::DropNotNull

Properties§

public Name $column

Methods§

public function __construct(public ColumnActionKind $kind, public Name $column)

Parameters

$kindColumnActionKindThe action
$columnNameThe column
public function deriveClause(Derivation $derivation, Environment $environment): void

Checks that the column exists, unless IF EXISTS is written.

Parameters

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

Writes ALTER, the column and the action.

Parameters

$outOutput
Calls 2

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 2
Type checks 5
Type declarations 1