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

Lowers the string literals that SQLite reads as column names in key constraints and index terms.

Rule: SQLITE-KEY-TERM-LOWER-001. Scope: the sortlist of PRIMARY KEY and UNIQUE table constraints and of CREATE INDEX, after the ordering rule lowered it. A term whose expression is a string literal under parentheses and COLLATE clauses (any number for a key constraint, at most one for an index term, SQLITE-KEY-TERM-001) is rebuilt around a LiteralColumn that holds the recorded literal leaf; the parentheses and collations are rebuilt in the same order. Every other term is left as it is. Terminates: the wrappers of a finite expression are peeled once and put back once. Source: https://sqlite.org/lang_createtable.html#the_primary_key, https://sqlite.org/lang_createindex.html (and sqlite3StringToId() in build.c of the release). Status: Implemented.

Methods§

public function indexTerms(list<SortTerm> $terms): list<SortTerm>

Lowers the terms of a CREATE INDEX statement.

Parameters

$termslist<SortTerm>

Returns

list<SortTerm>
Called from 1
Calls 2
public function term(SortTerm $term, int|null $collations): SortTerm

Rebuilds a term around a literal column when its expression is a string under the admitted wrappers.

Parameters

$termSortTerm
$collationsint|nullHow many COLLATE clauses may lie above the string; null for any number

Returns

Test cases 1
Called from 2
Calls 4
public function expression(Scalar $expression): Scalar

Rebuilds the parentheses and collations of an expression around a literal column in place of its string.

Parameters

$expressionScalar

Returns

Test cases 1
Called from 1
Calls 4

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 3
Method calls 3