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

ALTER [ COLUMN ] ... SET DEFAULT: the value a column takes when none is given.

Mirrors AT_ColumnDefault with def. The expression sees no column, as in a column definition. Source: https://www.postgresql.org/docs/17/sql-altertable.html.

Reading a new defaultdoctest
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t ALTER a SET DEFAULT 0');
    $statement->toString() // => 'ALTER TABLE t ALTER a SET DEFAULT 0'

Properties§

public Name $column
public Scalar $value

Methods§

public function __construct(public Name $column, public Scalar $value)

Parameters

$columnNameThe column
$valueScalarThe default expression
public function deriveClause(Derivation $derivation, Environment $environment): void

Checks that the column exists and derives the expression where no column is visible.

Parameters

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

Writes the action.

Parameters

$outOutput
Calls 1

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Type checks 3
Type declarations 1