classPrimaryKeyProblem
final class PrimaryKeyProblem
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.A table definition that states its primary key in a way SQLite rejects.
Source: https://sqlite.org/lang_createtable.html#the_primary_key.
(new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TABLE t (a TEXT PRIMARY KEY AUTOINCREMENT)') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY.Properties§
public PrimaryKeyFlaw $flawMethods§
public function __construct(public PrimaryKeyFlaw $flaw)Parameters
$flaw | PrimaryKeyFlaw | What is wrong with the primary key |
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 1
Other tests reaching this symbol 4
Relations§
Instantiated in 3
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableProblems::report() packages/sql-semantics-sqlite/src/Rules/Definition/TableProblems.php:68
- new SqlSemantics\Platform\Sqlite\Statement\Schema\Table\TablePrimaryKey::deriveConstraint() packages/sql-semantics-sqlite/src/Statement/Schema/Table/TablePrimaryKey.php:70
- new SqlSemantics\Platform\Sqlite\Statement\Schema\Table\TableUnique::deriveConstraint() packages/sql-semantics-sqlite/src/Statement/Schema/Table/TableUnique.php:65