final class InsertRowProjection

What one column of a rewritten INSERT ... VALUES will read back as.

A rewritten INSERT does not insert: it selects the row it would have written. Every column of the target therefore has to be accounted for, including the ones the statement left out, because a row read back without them is not the row a database would have stored. A column is written into the projection as exactly one of four things, and which one it is decides what the SELECT says in its place.

Methods§

public function __construct(
    private string $targetColumn,
    private ?string $providedExpression,
    private ?string $defaultExpression,
    private ?int $generatedIdentityValue,
    private bool $nullValue,
)

Binds one column of the projection to exactly one of the four things it can be.

Every way of building one goes through a named constructor, because which of the four it is decides what the SELECT says in its place.

Parameters

$targetColumnstring
$providedExpression?string
$defaultExpression?string
$generatedIdentityValue?int
$nullValuebool
Test cases 7
public static function defaultExpression(string $targetColumn, string $expression): self

Private surface 5§

Implementation details, listed for orientation only.

private string $targetColumn
private ?string $providedExpression
private ?string $defaultExpression
private ?int $generatedIdentityValue
private bool $nullValue

Test cases 8§

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

Dedicated tests 7
Other tests reaching this symbol 1

Relations§

Static calls 4