classCreateTableRule
final class CreateTableRule
Lowers table definitions.
Rule: SQLITE-CREATE-TABLE-LOWER-001. Scope: cmd: create_table create_table_args, create_table, createkw, create_table_args, columnlist. Constructors: CreateTable for a column list, CreateTableAs for a query. Columns keep their written order. TEMP and IF NOT EXISTS are model values. Terminates: the column list is walked along its spine in a loop. Source: https://sqlite.org/lang_createtable.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Calls 2
Lowers a table definition, or answers null for a command of another family.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 9
- method-call Form::node() line 53
- static-call ImplementationGap::production() line 55
- method-call CreateTableRule::created() line 57
- new CreateTable line 64
- method-call CreateTableRule::columns() line 66
- method-call TableConstraintRule::runs() line 67
- method-call TableConstraintRule::options() line 68
- method-call TableConstraintRule::leadingComma() line 71
- new CreateTableAs line 73
public function created(Node $keyword): voidChecks the CREATE keyword production that starts a definition.
Parameters
$keyword | Node |
Throws
ImplementationGap When the production has no ruleCalled from 4
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\CreateTableRule::command() packages/sql-semantics-sqlite/src/Lowering/Definition/CreateTableRule.php:57
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule::view() packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:96
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule::index() packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:112
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\VirtualTableRule::table() packages/sql-semantics-sqlite/src/Lowering/Definition/VirtualTableRule.php:83
Calls 1
- static-call ImplementationGap::production() line 87
public function columns(Node $list): list<ColumnDefinition>Lowers the column definitions in written order.
Parameters
$list | Node |
Returns
list<ColumnDefinition>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- static-call ImplementationGap::production() line 105
- function-call
array_reverseline 110 - method-call ColumnRule::column() line 111
Private surface 3§
Implementation details, listed for orientation only.
private ColumnRule $columnsprivate TableConstraintRule $constraintsprivate 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
CreateTableRuleTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\Sqlite\Lowering\Definition\DefinitionCommands::__construct() packages/sql-semantics-sqlite/src/Lowering/Definition/DefinitionCommands.php:50
- new SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule::__construct() packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:60
- new SqlSemantics\Platform\Sqlite\Lowering\Definition\VirtualTableRule::__construct() packages/sql-semantics-sqlite/src/Lowering/Definition/VirtualTableRule.php:56
Method calls 4
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\DefinitionCommands::command() packages/sql-semantics-sqlite/src/Lowering/Definition/DefinitionCommands.php:65
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule::view() packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:96
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule::index() packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:112
- method-call SqlSemantics\Platform\Sqlite\Lowering\Definition\VirtualTableRule::table() packages/sql-semantics-sqlite/src/Lowering/Definition/VirtualTableRule.php:83
Type declarations 3
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\DefinitionCommands packages/sql-semantics-sqlite/src/Lowering/Definition/DefinitionCommands.php:36
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:51
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\VirtualTableRule packages/sql-semantics-sqlite/src/Lowering/Definition/VirtualTableRule.php:49