classDefaultChange
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.
$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 $columnpublic Scalar $valueMethods§
public function __construct(public Name $column, public Scalar $value)Parameters
$column | Name | The column |
$value | Scalar | The default expression |
public function deriveClause(Derivation $derivation, Environment $environment): voidChecks that the column exists and derives the expression where no column is visible.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 4
- method-call Alterations::column() line 44
- new Alterations line 44
- method-call Derivation::scalar() line 45
- method-call Derivation::environment() line 45
public function render(Output $out): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
DefaultChangeTestcalls
Relations§
Instantiated in 1
Type checks 3
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Command\AlterKinds::other() packages/sql-semantics-postgres/src/Rules/Table/Command/AlterKinds.php:158
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Command\GeneratedChanges::check() packages/sql-semantics-postgres/src/Rules/Table/Command/GeneratedChanges.php:53
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Command\GeneratedChanges::rule() packages/sql-semantics-postgres/src/Rules/Table/Command/GeneratedChanges.php:72