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

Lowers the table constraints and the table options of a table definition.

Rule: SQLITE-TABLE-CONSTRAINT-LOWER-001. Scope: conslist_opt, conslist, tconscomma, tcons, table_option_set, table_option. Constructors: ConstraintRun, ConstraintName, TablePrimaryKey, TableUnique, TableCheck, ForeignKey, TableOption. A written comma between two constraints ends a run; a missing one continues it, so the place of every comma is kept, as is a comma the grammar admits before the first table option. A string literal among the key terms is lowered by SQLITE-KEY-TERM-LOWER-001. Terminates: both lists are flattened iteratively. Source: https://sqlite.org/syntax/table-constraint.html, https://sqlite.org/syntax/table-options.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
Calls 3
public function runs(Node $list): list<ConstraintRun>

Lowers the optional constraint list into comma-separated runs.

Parameters

$listNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 5
public function options(Node $set): list<TableOption>

Lowers the table options in written order.

Parameters

$setNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 5
public function leadingComma(Node $set): bool

Tells whether a comma is written before the first table option, which the grammar admits after an empty option set.

Parameters

$setNode

Returns

bool

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 4

Private surface 4§

Implementation details, listed for orientation only.

private ForeignKeyRule $foreignKeys
private ColumnRule $columns
private WordRule $words
private Lowering $lowering

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Method calls 3
Type declarations 1