final class ColumnTarget
    implements Clause
    uses Snapshot
Public API: explicitly declared with @visibility public.

A column an INSERT column list or an assignment writes, with the subscripts and fields of the part written.

Mirrors the name and indirection of PostgreSQL's ResTarget in an INSERT column list or an UPDATE SET item. The name is always a column of the written table, never a table qualifier. Source: https://www.postgresql.org/docs/17/sql-insert.html, https://www.postgresql.org/docs/17/sql-update.html.

Reading the element an assignment writesdoctest
$update = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('UPDATE t SET a[1] = 2');
    [$update->statement->assignments[0]->column->column->value, count($update->statement->assignments[0]->column->steps)] // => ['a', 1]

Properties§

public list<IndirectionStep> $steps
public Name $column

Methods§

public function __construct(public Name $column, list<IndirectionStep> $steps = [])

Parameters

$columnNameThe column name
$stepslist<IndirectionStep>The subscripts and field selections after the column name

Throws

InvalidConstruction When a step is not an indirection step
Calls 2
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the subscript expressions of the steps.

Parameters

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

Writes the column name and the steps.

Parameters

$outOutput
Calls 3

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 2
Constant reads 4
Type declarations 5