final class CommonTable
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One common table expression: a named query, optionally with column names and a materialization hint.

Source: https://sqlite.org/lang_with.html.

Reading a common table expressiondoctest
$query = (new \SqlSemantics\Platform\Sqlite\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]->name->value] // => ['c', 'x']

Properties§

public list<ListedColumn> $columns
public Name $name
public Query $query
public Materialization|null $materialization = null

Methods§

public function __construct(
    public Name $name,
    public Query $query,
    list<ListedColumn> $columns = [],
    public Materialization|null $materialization = null,
)

Parameters

$nameNameThe table name
$queryQueryThe query
$columnslist<ListedColumn>The column names; none when the list is absent
$materializationMaterialization|nullThe written hint
Calls 2
public function render(Output $out): void

Writes the definition.

Parameters

$outOutput
Calls 5

Test cases 6§

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 5

Relations§

Instantiated in 1
Constant reads 1
Type checks 2
Type declarations 4