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

ALTER [ COLUMN ] ... SET EXPRESSION AS ( expression ): replaces the expression of a generated column.

Mirrors AT_SetExpression (PostgreSQL 17). The expression is derived where the columns of the relation are visible. Source: https://www.postgresql.org/docs/17/sql-altertable.html.

Replacing a generation expressiondoctest
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t ALTER b SET EXPRESSION AS (a * 2)');
    $statement->toString() // => 'ALTER TABLE t ALTER b SET EXPRESSION AS (a * 2)'

Properties§

public Name $column
public Scalar $expression

Methods§

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

Parameters

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

Checks that the column exists and derives the expression against the relation.

Parameters

$derivationDerivation
$environmentEnvironment
Calls 5
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