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

Lowers the key part lists of indexes and foreign keys.

Rule: MYSQL-KEY-PART-001. Scope: key_list, key_part, key_list_with_expression, key_part_with_expression. In MySQL 5.x the sort direction follows the key part in the list production; in 8.0 it belongs to the key part. A prefix length is kept as written. Constructs: ColumnPart, ExpressionPart. Terminates: lists are flattened iteratively. 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 columns(Node $list): non-empty-list<ColumnPart>

Lowers the columns of a foreign key: a node of key_list.

Parameters

$listNode

Returns

non-empty-list<ColumnPart>

Throws

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

Private surface 2§

Implementation details, listed for orientation only.

private const LISTS = ['key_list: key_list , key_part order_dir', 'key_list: key_part order_dir', 'ke…
private Lowering $lowering

Test cases 4§

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

Dedicated tests 4

Relations§

Instantiated in 4
Method calls 4