final class GeneratedColumnWrite
    implements Diagnostic
    uses Snapshot
Public API: explicitly declared with @visibility public.

A statement that writes a generated column, which SQLite rejects.

The value of a generated column is computed from the other columns of its row, so an INSERT cannot name it in its column list and an UPDATE or an upsert cannot assign it (SQLITE-GENERATED-WRITE-001). The column is named as it is declared, as SQLite does in its message. Source: https://sqlite.org/gencol.html.

Reporting an UPDATE of a generated columndoctest
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
    $table = $semantics->analyze('CREATE TABLE t (a, b AS (a + 1))');
    $semantics->analyze('UPDATE t SET B = 1', [$table]) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: cannot UPDATE generated column "b"

Properties§

public WriteKind $write
public Name $column

Methods§

public function __construct(public WriteKind $write, public Name $column)

Parameters

$writeWriteKindHow the statement writes the column
$columnNameThe generated column, as declared
public function message(): string

Describes the problem in the words of SQLite.

Returns

string
Test cases 1

Test cases 4§

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

Dedicated tests 2
Other tests reaching this symbol 2

Relations§

Instantiated in 2