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

SEARCH DEPTH FIRST or BREADTH FIRST BY columns SET column: an ordering column added to a recursive query.

Mirrors PostgreSQL's CTESearchClause. The sequence column is appended to the columns of the common table; the BY columns name columns of it. Source: https://www.postgresql.org/docs/17/queries-with.html#QUERIES-WITH-SEARCH.

Reading a search clausedoctest
$clause = new \SqlSemantics\Platform\PostgreSql\Statement\Query\With\SearchClause(\SqlSemantics\Platform\PostgreSql\Statement\Query\With\SearchOrder::Depth, [new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('id')], new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('ordercol'));
    [$clause->order->value, $clause->sequence->value] // => ['DEPTH', 'ordercol']

Properties§

public non-empty-list<Name> $columns
public SearchOrder $order
public Name $sequence

Methods§

public function __construct(
    public SearchOrder $order,
    list<Name> $columns,
    public Name $sequence,
)

Parameters

$orderSearchOrderDepth-first or breadth-first
$columnslist<Name>The columns the order follows; at least one
$sequenceNameThe name of the added ordering column
Calls 2
public function render(Output $out): void

Writes the clause.

Parameters

$outOutput
Test cases 1
Calls 4

Test cases 3§

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 2

Relations§

Instantiated in 1
Type declarations 2