classWithRule
final class WithRule
Lowers WITH clauses and their common table expressions.
Rule: PG-WITH-LOWER-001. Scope: opt_with_clause, with_clause, cte_list, common_table_expr, opt_materialized, opt_search_clause, opt_cycle_clause. Constructors: WithClause, CommonTableExpression, SearchClause, CycleClause. The statement of a common table is lowered by the manipulation family (PreparableStmt). Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/queries-with.html. Status: Implemented.
Methods§
public function with(Node $clause): ?WithClauseLowers with_clause or opt_with_clause; no clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\Queries::with() packages/sql-semantics-postgres/src/Lowering/Query/Queries.php:154
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\SelectRule::attach() packages/sql-semantics-postgres/src/Lowering/Query/SelectRule.php:165
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\WithRule::with() packages/sql-semantics-postgres/src/Lowering/Query/WithRule.php:51
Calls 4
- method-call WithRule::with() line 51
- new WithClause line 52
- method-call WithRule::tables() line 52
- static-call ImplementationGap::production() line 54
public function tables(Node $list): list<CommonTableExpression>Lowers cte_list.
Parameters
$list | Node |
Returns
list<CommonTableExpression>Throws
ImplementationGap When an item has no rule or its statement is not a queryTest cases 1
Called from 2
Calls 7
- method-call Lowering::items() line 68
- static-call ImplementationGap::production() line 71
- static-call ImplementationGap::rule() line 75
- new CommonTableExpression line 77
- method-call WithRule::materialization() line 81
- method-call WithRule::search() line 82
- method-call WithRule::cycle() line 83
public function materialization(Node $clause): ?MaterializationLowers opt_materialized; no clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 3
- class-const Materialization::Materialized() line 100
- class-const Materialization::NotMaterialized() line 101
- static-call ImplementationGap::production() line 103
public function search(Node $clause): ?SearchClauseLowers opt_search_clause; no clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 4
- class-const SearchOrder::Depth() line 116
- class-const SearchOrder::Breadth() line 117
- static-call ImplementationGap::production() line 119
- new SearchClause line 122
public function cycle(Node $clause): ?CycleClauseLowers opt_cycle_clause; no clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 2
- new CycleClause line 136
- static-call ImplementationGap::production() line 145
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.