classSearchClause
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.
$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> $columnspublic SearchOrder $orderpublic Name $sequenceMethods§
public function __construct(
public SearchOrder $order,
list<Name> $columns,
public Name $sequence,
)Parameters
$order | SearchOrder | Depth-first or breadth-first |
$columns | list<Name> | The columns the order follows; at least one |
$sequence | Name | The name of the added ordering column |
Calls 2
- static-call Check::listOf() line 42
- class-const Name::class() line 42
public function render(Output $out): voidWrites the clause.
Parameters
$out | Output |
Test cases 1
Calls 4
- method-call Output::keyword() line 50
- method-call Output::symbol() line 53
- method-call Output::name() line 55
- class-const NameUse::Column() line 55
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.