classWithClause
final class WithClause
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.A WITH clause: the common table expressions of one statement.
Source: https://sqlite.org/lang_with.html.
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('WITH RECURSIVE c(x) AS (SELECT 1 UNION ALL SELECT x + 1 FROM c) SELECT x FROM c');
[$query->statement->with->recursive, count($query->statement->with->tables)] // => [true, 1]Properties§
public non-empty-list<CommonTable> $tablespublic bool $recursive = falseMethods§
public function __construct(list<CommonTable> $tables, public bool $recursive = false)Parameters
$tables | list<CommonTable> | The common table expressions in written order; at least one |
$recursive | bool | Whether RECURSIVE is written |
Calls 2
- static-call Check::listOf() line 37
- class-const CommonTable::class() line 37
public function render(Output $out): voidWrites the clause.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 45
- method-call Output::list() line 49
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 4
Relations§
Instantiated in 1
Type declarations 10
- type SqlSemantics\Platform\Sqlite\Lowering\Mutation\MutationRule packages/sql-semantics-sqlite/src/Lowering/Mutation/MutationRule.php:76
- type SqlSemantics\Platform\Sqlite\Lowering\Mutation\MutationRule packages/sql-semantics-sqlite/src/Lowering/Mutation/MutationRule.php:104
- type SqlSemantics\Platform\Sqlite\Lowering\Query\WithRule packages/sql-semantics-sqlite/src/Lowering/Query/WithRule.php:39
- type SqlSemantics\Platform\Sqlite\Lowering\Query\WithRule packages/sql-semantics-sqlite/src/Lowering/Query/WithRule.php:56
- type SqlSemantics\Platform\Sqlite\Rules\Mutation\MutationScope packages/sql-semantics-sqlite/src/Rules/Mutation/MutationScope.php:53
- type SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:52
- type SqlSemantics\Platform\Sqlite\Statement\Mutation\Delete packages/sql-semantics-sqlite/src/Statement/Mutation/Delete.php:51
- type SqlSemantics\Platform\Sqlite\Statement\Mutation\InsertInto packages/sql-semantics-sqlite/src/Statement/Mutation/InsertInto.php:50
- type SqlSemantics\Platform\Sqlite\Statement\Mutation\Update packages/sql-semantics-sqlite/src/Statement/Mutation/Update.php:74
- type SqlSemantics\Platform\Sqlite\Statement\Query\With\WithQuery packages/sql-semantics-sqlite/src/Statement/Query/With/WithQuery.php:41