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

Lowers view and index definitions, DROP and ALTER TABLE.

Rule: SQLITE-SCHEMA-LOWER-001. Scope: the cmd productions of CREATE VIEW, CREATE INDEX, DROP TABLE, DROP VIEW, DROP INDEX, DROP TRIGGER and ALTER TABLE, with uniqueflag, ifexists, add_column_fullname and kwcolumn_opt. Constructors: CreateView, CreateIndex, Drop, AlterRenameTable, AlterAddColumn, AlterDropColumn, AlterRenameColumn. UNIQUE, TEMP, IF EXISTS and IF NOT EXISTS are model values; the COLUMN keyword of ALTER TABLE is declared noise. A string literal among the index terms is lowered by SQLITE-KEY-TERM-LOWER-001. Terminates: fixed number of children. Source: https://sqlite.org/lang_createview.html, https://sqlite.org/lang_createindex.html, https://sqlite.org/lang_droptable.html, https://sqlite.org/lang_altertable.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
Calls 2
public function ifExists(Node $clause): bool

Lowers the optional IF EXISTS clause.

Parameters

$clauseNode

Returns

bool

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 1
public function added(Node $name): QualifiedName

Lowers the table name of ALTER TABLE ADD COLUMN.

Parameters

$nameNode

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 1

Private surface 4§

Implementation details, listed for orientation only.

private const DROPS = ['cmd: DROP TABLE ifexists fullname' => \SqlSemantics\Platform\Sqlite\Statement…
private CreateTableRule $tables
private ColumnRule $columns
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 1
Type declarations 1