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.

Reading a WITH clausedoctest
$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> $tables
public bool $recursive = false

Methods§

public function __construct(list<CommonTable> $tables, public bool $recursive = false)

Parameters

$tableslist<CommonTable>The common table expressions in written order; at least one
$recursiveboolWhether RECURSIVE is written
Calls 2
public function render(Output $out): void

Writes the clause.

Parameters

$outOutput
Calls 2

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