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

Lowers the filtering, grouping, window and ordering clauses of every grammar generation.

Rule: MYSQL-QUERY-CLAUSES-001. Scope: where_clause, opt_where_clause, having_clause, opt_having_clause, opt_qualify_clause, group_clause, opt_group_clause, group_list, grouping_expr, olap_opt, opt_order_clause, order_clause, order_list, order_expr, order_ident, order_dir, opt_ordering_direction, ordering_direction, opt_window_clause, window_definition_list, window_definition. A clause that writes nothing is absent. Ordering and grouping items keep their written order and direction; in a query ORDER BY or GROUP BY an unsigned integer item is a select list position (MYSQL-ORDINAL-001), elsewhere (windows, GROUP_CONCAT) it is the expression it is. Constructs: Grouping, GroupingModifier, OrderItem, OutputOrdinal, WindowDefinition. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/select.html, https://dev.mysql.com/doc/refman/8.4/en/group-by-modifiers.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function predicate(Node $clause): ?Scalar

Lowers a WHERE, HAVING or QUALIFY clause; an absent clause is null.

Parameters

$clauseNode

Returns

Throws

ImplementationGap When the production has no rule
Called from 11
Calls 4
public function modifier(Node $modifier): ?GroupingModifier

Lowers the modifier written after a grouping list.

Parameters

$modifierNode

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 4
public function windows(Node $clause): list<WindowDefinition>

Private surface 5§

Implementation details, listed for orientation only.

private const PREDICATES = ['opt_where_clause:' => null, 'where_clause:' => null, 'opt_where_clause: WHERE…
private const DIRECTIONS = ['order_dir:' => null, 'opt_ordering_direction:' => null, 'order_dir: ASC' => \…
private const LISTS = ['order_list: order_list , order_ident order_dir' => true, 'order_list: order_i…
private const MODIFIERS = ['olap_opt:' => null, 'olap_opt: WITH_CUBE_SYM' => \SqlSemantics\Platform\MySql…
private Lowering $lowering

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 12
Method calls 26