classIndexRule
final class IndexRule
Lowers CREATE INDEX.
Rule: MYSQL-CREATE-INDEX-LOWERING-001. Scope: the create alternatives CREATE opt_unique INDEX_SYM …, CREATE fulltext INDEX_SYM … and CREATE spatial INDEX_SYM … (5.x), create_index_stmt (8.0 and later), opt_unique, fulltext, spatial. The ALGORITHM and LOCK clauses come from the table change family. Constructs: CreateIndex. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/create-index.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function index(Form $form): CreateIndexLowers CREATE INDEX: the form of a 5.x create alternative or of create_index_stmt.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\IndexRule::statement() packages/sql-semantics-mysql/src/Lowering/TableDefinition/IndexRule.php:105
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\TableDefinitionRules::definition() packages/sql-semantics-mysql/src/Lowering/TableDefinition/TableDefinitionRules.php:71
Calls 10
- class-const IndexRule::FORMS() line 66
- static-call ImplementationGap::production() line 66
- new KeyOptionRule line 69
- new CreateIndex line 71
- method-call Form::node() line 72
- method-call KeyPartRule::parts() line 74
- new KeyPartRule line 74
- class-const IndexRule::KINDS() line 75
- method-call IndexRule::structure() line 76
- method-call KeyOptionRule::options() line 77
public function structure(Node $clause, KeyOptionRule $rule): ?IndexAlgorithmLowers the structure clause before ON: a node of key_alg, opt_index_type_clause or the marker init_key_options.
Parameters
$clause | Node | |
$rule | KeyOptionRule |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 1
- method-call KeyOptionRule::algorithm() line 95
public function statement(Node $statement): CreateIndexLowers CREATE INDEX of MySQL 8.0 and later: a node of create_index_stmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 1
- method-call IndexRule::index() line 105
Private surface 3§
Implementation details, listed for orientation only.
private const FORMS = ['create: CREATE opt_unique INDEX_SYM ident key_alg ON table_ident ( key_list )…private const KINDS = ['opt_unique:' => \SqlSemantics\Platform\MySql\Statement\Table\Key\IndexKind::I…private Lowering $loweringTest cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\TableDefinition\TableDefinitionRules::statement() packages/sql-semantics-mysql/src/Lowering/TableDefinition/TableDefinitionRules.php:52
- new SqlSemantics\Platform\MySql\Lowering\TableDefinition\TableDefinitionRules::definition() packages/sql-semantics-mysql/src/Lowering/TableDefinition/TableDefinitionRules.php:71
Method calls 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\TableDefinitionRules::statement() packages/sql-semantics-mysql/src/Lowering/TableDefinition/TableDefinitionRules.php:52
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\TableDefinitionRules::definition() packages/sql-semantics-mysql/src/Lowering/TableDefinition/TableDefinitionRules.php:71