interface RecursiveDefinition
    extends Node
Public API: explicitly declared with @visibility public.

A named relation whose query may refer to itself: a common table expression, or a recursive view.

When such a relation is bound while its own query is derived, the second operand of the UNION that computes it sees the relation with the columns of the first operand, renamed by the column names written for it (PG-SET-OPERATION-001). The server reads CREATE RECURSIVE VIEW v (a) AS q as a view over WITH RECURSIVE v (a) AS (q), so both kinds share the rule. Source: https://www.postgresql.org/docs/17/queries-with.html#QUERIES-WITH-RECURSIVE, https://www.postgresql.org/docs/17/sql-createview.html.

Reading the recursive query of a common table expressiondoctest
$one = new \SqlSemantics\Platform\PostgreSql\Statement\Query\Select([new \SqlSemantics\Platform\PostgreSql\Statement\Query\ExpressionTarget(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\Constant(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('1')))]);
    $table = new \SqlSemantics\Platform\PostgreSql\Statement\Query\With\CommonTableExpression(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('x'), $one, [new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('a')]);
    [$table->recursiveQuery() === $one, $table->recursiveColumns()[0]->value] // => [true, 'a']

Methods§

public function recursiveQuery(): Query

Answers the query that computes the rows and may refer to the relation itself.

Returns

public function recursiveColumns(): list<Name>

Answers the column names written for the relation, in order; empty when none are written.

Returns

list<Name>

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Implemented by 2
Type checks 1