classSchemaRule
final class SchemaRule
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
$lowering | Lowering | The lowering this rule belongs to |
Calls 2
- new CreateTableRule line 60
- new ColumnRule line 61
Lowers a schema command, or answers null for a command of another family.
Parameters
$form | Form |
Returns
Called from 1
Calls 13
- class-const SchemaRule::DROPS() line 69
- new Drop line 70
- method-call Form::node() line 70
- method-call SchemaRule::ifExists() line 70
- method-call SchemaRule::view() line 74
- method-call SchemaRule::index() line 75
- new AlterRenameTable line 76
- new AlterAddColumn line 77
- method-call SchemaRule::added() line 78
- method-call ColumnRule::column() line 79
- method-call SchemaRule::keyword() line 79
- new AlterDropColumn line 81
- new AlterRenameColumn line 82
public function view(Form $form): CreateViewLowers a view definition.
Parameters
$form | Form |
Returns
Called from 1
Calls 3
- method-call CreateTableRule::created() line 96
- method-call Form::node() line 96
- new CreateView line 102
public function index(Form $form): CreateIndexLowers an index definition.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- method-call CreateTableRule::created() line 112
- method-call Form::node() line 112
- static-call ImplementationGap::production() line 117
- method-call KeyTermRule::indexTerms() line 122
- new KeyTermRule line 122
- new CreateIndex line 124
public function ifExists(Node $clause): boolLowers the optional IF EXISTS clause.
Parameters
$clause | Node |
Returns
boolThrows
ImplementationGap When the production has no ruleCalled from 1
Calls 1
- static-call ImplementationGap::production() line 139
public function added(Node $name): QualifiedNameLowers the table name of ALTER TABLE ADD COLUMN.
Parameters
$name | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 1
- static-call ImplementationGap::production() line 154
Checks the optional COLUMN keyword and answers the node that follows it.
Returns
Throws
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule::command() packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:79
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule::command() packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:81
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule::command() packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:84
Calls 1
- static-call ImplementationGap::production() line 169
Private surface 4§
Implementation details, listed for orientation only.
private const DROPS = ['cmd: DROP TABLE ifexists fullname' => \SqlSemantics\Platform\Sqlite\Statement…private CreateTableRule $tablesprivate ColumnRule $columnsprivate Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SchemaRuleTestcalls