classPrimaryRule
final class PrimaryRule
Lowers the query primaries and the WITH clause of the 8.0 and later grammars.
Rule: MYSQL-QUERY-PRIMARY-001. Scope: query_primary, query_specification (8.0 and later), table_value_constructor, values_row_list, row_value_explicit, explicit_table, with_clause, opt_with_clause, with_list, common_table_expr. A query specification is a query block whose INTO clause, when written, follows the select list. Constructs: the query block, ValuesQuery, ValueRow, ExplicitTable, With, CommonTableExpression. 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/values.html, https://dev.mysql.com/doc/refman/8.4/en/table.html, https://dev.mysql.com/doc/refman/8.4/en/with.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers a query primary: a query block, a VALUES statement or a TABLE statement.
Parameters
$primary | Node |
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 5
- method-call Lowering::form() line 67
- method-call PrimaryRule::specification() line 70
- method-call PrimaryRule::values() line 71
- method-call PrimaryRule::explicit() line 72
- static-call ImplementationGap::production() line 73
Lowers a query specification into an open query block.
Parameters
$specification | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 15
- method-call Lowering::form() line 84
- class-const PrimaryRule::SPECIFICATIONS() line 85
- static-call ImplementationGap::production() line 85
- new ClauseRule line 87
- new ItemRule line 88
- new Block line 90
- method-call ItemRule::options() line 91
- method-call ItemRule::items() line 92
- method-call TailRule::into() line 93
- new TailRule line 93
- method-call FromRule::from() line 94
- new FromRule line 94
- method-call ClauseRule::predicate() line 95
- method-call ClauseRule::grouping() line 96
- method-call ClauseRule::windows() line 98
public function values(Node $constructor): ValuesQueryLowers a VALUES statement.
Parameters
$constructor | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- method-call Lowering::form() line 110
- static-call ImplementationGap::production() line 112
- method-call Lists::items() line 119
- new Lists line 119
- new ValueRow line 124
- new ValuesQuery line 127
public function explicit(Node $table): ExplicitTableLowers a TABLE statement.
Parameters
$table | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 3
- method-call Lowering::form() line 137
- static-call ImplementationGap::production() line 139
- new ExplicitTable line 142
Lowers a WITH clause; an absent clause is null.
Parameters
$clause | Node |
Returns
?WithThrows
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:116
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\PrimaryRule::with() packages/sql-semantics-mysql/src/Lowering/Query/Modern/PrimaryRule.php:157
- method-call SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::with() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:251
Calls 11
- method-call Lowering::form() line 152
- method-call PrimaryRule::with() line 157
- static-call ImplementationGap::production() line 162
- method-call Lists::items() line 169
- new Lists line 169
- new CommonTableExpression line 174
- method-call TableRule::columns() line 174
- new TableRule line 174
- method-call ExpressionRule::subquery() line 174
- new ExpressionRule line 174
- new With line 177
Private surface 2§
Implementation details, listed for orientation only.
private const SPECIFICATIONS = ['query_specification: SELECT_SYM select_options select_item_list into_clause o…private Lowering $loweringRelations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:116
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::body() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:143
- new SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::with() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:251
Method calls 3
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:116
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::body() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:143
- method-call SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::with() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:251