classCycleClause
final class CycleClause
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.CYCLE columns SET mark [TO value DEFAULT value] USING path: cycle detection added to a recursive query.
Mirrors PostgreSQL's CTECycleClause. The mark column and the path column are appended to the columns of the common table. Without the TO and DEFAULT values the mark is a boolean that is true on a cycle. The WITH clause derives the values, which see no column. Source: https://www.postgresql.org/docs/17/queries-with.html#QUERIES-WITH-CYCLE.
$clause = new \SqlSemantics\Platform\PostgreSql\Statement\Query\With\CycleClause([new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('id')], new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('is_cycle'), new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('path'));
[$clause->mark->value, $clause->path->value, $clause->markValue] // => ['is_cycle', 'path', null]new \SqlSemantics\Platform\PostgreSql\Statement\Query\With\CycleClause([new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('id')], new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('m'), new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('p'), new \SqlSemantics\Platform\PostgreSql\Statement\Literal\BooleanLiteral(true)) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionProperties§
public non-empty-list<Name> $columnspublic Name $markpublic Name $pathpublic Scalar|null $markValue = nullpublic Scalar|null $markDefault = nullMethods§
public function __construct(
list<Name> $columns,
public Name $mark,
public Name $path,
public Scalar|null $markValue = null,
public Scalar|null $markDefault = null,
)Parameters
Calls 3
- static-call Check::listOf() line 49
- class-const Name::class() line 49
- static-call Check::input() line 50
public function render(Output $out): voidWrites the clause.
Parameters
$out | Output |
Test cases 1
Calls 4
- method-call Output::keyword() line 58
- method-call Output::symbol() line 61
- method-call Output::name() line 63
- class-const NameUse::Column() line 63
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.