classGeneratedColumnWrite
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).
$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 $columnpublic Name $tableMethods§
public function message(): stringDescribes the problem in the words of the server.
Returns
stringTest cases 1
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.