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

A value other than DEFAULT that a statement writes into a generated column.

The server names the column and the table as they are declared, not as the statement spells them. Source: https://dev.mysql.com/doc/refman/8.4/en/create-table-generated-columns.html, https://dev.mysql.com/doc/mysql-errors/8.4/en/server-error-reference.html (ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN).

Reading the generated column written by an INSERTdoctest
$semantics = new \SqlSemantics\Platform\MySql\Semantics();
    $table = $semantics->analyze('CREATE TABLE t (a INT, g INT AS (a + 1))');
    $semantics->analyze('INSERT INTO t (a, g) VALUES (1, 2)', $table->declarations()) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: The value specified for generated column 'g' in table 't' is not allowed.

Properties§

public Name $column
public Name $table

Methods§

public function __construct(public Name $column, public Name $table)

Parameters

$columnNameThe declared name of the generated column
$tableNameThe declared name of its table
public function message(): string

Describes the problem in the words of the server.

Returns

string
Test cases 1

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 2