final class PrimaryKeyRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\Sqlite". Code outside that scope must not name this declaration.

Finds the primary key of a table definition and whether it is the row identifier.

Rule: SQLITE-PRIMARY-KEY-001. The first PRIMARY KEY constraint in written order is the primary key; a further one is an error. A key of exactly one column whose declared type is the standard name INTEGER is an integer primary key, an alias of the rowid, with one exception that the manual documents as a quirk kept for compatibility: the column constraint INTEGER PRIMARY KEY DESC is not an alias, while the table constraint PRIMARY KEY (x DESC) is. A term of a table constraint names a key column when it is a plain name (SQLITE-KEY-TERM-001) of a declared column, compared without regard to ASCII case. Terminates: one pass over the constraints. Source: https://sqlite.org/lang_createtable.html#the_primary_key, https://sqlite.org/lang_createtable.html#rowid. Status: Implemented.

Methods§

public function tableKey(
    CreateTable $definition,
    TablePrimaryKey $constraint,
    list<ColumnDomain> $domains,
    Comparison $names,
): TableKey

Test cases 7§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 7

Relations§

Instantiated in 1
Method calls 1