classCommonTableExpression
final class CommonTableExpression
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One common table expression: name [(columns)] AS (query).
The query is the one inside the parentheses the syntax requires. The WITH clause that holds the expression derives it (MYSQL-WITH-001). Source: https://dev.mysql.com/doc/refman/8.4/en/with.html.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('WITH c (x) AS (SELECT 1) SELECT x FROM c');
[$query->statement->with->tables[0]->name->value, $query->statement->with->tables[0]->columns[0]->value] // => ['c', 'x']Properties§
public list<Name> $columnspublic Name $namepublic Query $queryMethods§
Parameters
Calls 2
- static-call Check::listOf() line 43
- class-const Name::class() line 43
public function render(Output $out): voidWrites the expression.
Parameters
$out | Output |
Calls 5
- method-call Output::name() line 51
- class-const NameUse::Relation() line 51
- method-call Output::symbol() line 53
- class-const NameUse::Column() line 58
- method-call Output::keyword() line 62
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.