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

A table definition that uses a generated column in a way SQLite rejects.

"Generated columns may not be used as part of the PRIMARY KEY", "generated

  • columns may not have a default value", and "every table must have at
  • least one non-generated column".

Source: https://sqlite.org/gencol.html#limitations.

Reporting a table made of generated columns onlydoctest
(new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TABLE t (a AS (1))') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: A table must have at least one column that is not generated.

Properties§

public Name|null $column = null

Methods§

public function __construct(public GeneratedColumnFlaw $flaw, public Name|null $column = null)

Parameters

$flawGeneratedColumnFlawWhat is wrong
$columnName|nullThe generated column, or null when the problem is the table as a whole
public function message(): string

Describes the problem.

Returns

string
Test cases 1

Test cases 5§

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 3

Relations§

Instantiated in 3