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

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

$loweringLoweringThe lowering this rule belongs to
public function structure(Node $clause, KeyOptionRule $rule): ?IndexAlgorithm

Lowers the structure clause before ON: a node of key_alg, opt_index_type_clause or the marker init_key_options.

Parameters

$clauseNode
$ruleKeyOptionRule

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 1
public function statement(Node $statement): CreateIndex

Lowers CREATE INDEX of MySQL 8.0 and later: a node of create_index_stmt.

Parameters

$statementNode

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 1

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 $lowering

Test cases 3§

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

Dedicated tests 3

Relations§

Instantiated in 2
Method calls 2