classGeneratedColumnProblem
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.
(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 GeneratedColumnFlaw $flawpublic Name|null $column = nullMethods§
public function __construct(public GeneratedColumnFlaw $flaw, public Name|null $column = null)Parameters
$flaw | GeneratedColumnFlaw | What is wrong |
$column | Name|null | The generated column, or null when the problem is the table as a whole |
public function message(): stringDescribes the problem.
Returns
stringTest 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
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableProblems::generated() packages/sql-semantics-sqlite/src/Rules/Definition/TableProblems.php:84
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableProblems::generated() packages/sql-semantics-sqlite/src/Rules/Definition/TableProblems.php:88
- new SqlSemantics\Platform\Sqlite\Statement\Schema\Column\ColumnDefinition::deriveColumn() packages/sql-semantics-sqlite/src/Statement/Schema/Column/ColumnDefinition.php:119