enumPrimaryKeyFlaw
enum PrimaryKeyFlaw: string
Public API: explicitly declared with
@visibility public.The ways a table definition can state its primary key wrongly.
Source: https://sqlite.org/lang_createtable.html#the_primary_key, https://sqlite.org/autoinc.html, https://sqlite.org/withoutrowid.html.
$create = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TABLE t (a PRIMARY KEY, b PRIMARY KEY)');
$create->facts->diagnostics[0]->flaw // => \SqlSemantics\Platform\Sqlite\Statement\Schema\Problem\PrimaryKeyFlaw::RepeatedCases§
case Repeated = 'The table has more than one primary key.'case MissingWithoutRowid = 'A WITHOUT ROWID table needs a primary key.'case ExpressionTerm = 'A primary key or unique constraint contains an expression that is not a column…case AutoincrementNotIntegerKey = 'AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY.'case AutoincrementWithoutRowid = 'AUTOINCREMENT is not allowed on a WITHOUT ROWID table.'Test cases 4§
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 3
Relations§
Constant reads 6
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\TableProblems::report() packages/sql-semantics-sqlite/src/Rules/Definition/TableProblems.php:61
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\TableProblems::report() packages/sql-semantics-sqlite/src/Rules/Definition/TableProblems.php:62
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\TableProblems::report() packages/sql-semantics-sqlite/src/Rules/Definition/TableProblems.php:63
- class-const SqlSemantics\Platform\Sqlite\Rules\Definition\TableProblems::report() packages/sql-semantics-sqlite/src/Rules/Definition/TableProblems.php:64
- class-const SqlSemantics\Platform\Sqlite\Statement\Schema\Table\TablePrimaryKey::deriveConstraint() packages/sql-semantics-sqlite/src/Statement/Schema/Table/TablePrimaryKey.php:70
- class-const SqlSemantics\Platform\Sqlite\Statement\Schema\Table\TableUnique::deriveConstraint() packages/sql-semantics-sqlite/src/Statement/Schema/Table/TableUnique.php:65