Create WithClosure object
In the current state of the project, algebra.relations.Select
have a with_relations
attribute, which allows a given tuple of algebra.relations.With
to be closed locally on the given algebra.relations.Select
. This does not allow to close the algebra.relations.With
on a set combination of algebra.relations.Select
, e.g.,
-- this works in Postgresql
SELECT source, target FROM (
WITH edges_again AS (
SELECT source, target FROM edges
)
SELECT source, target FROM edges_again
UNION
SELECT target, source FROM edges_again
)
I suggest to:
- remove the
with_relations
attribute ofalgebra.relations.Select
- create a new relation class, say
algebra.relation.WithClosure
which wraps a given relation of typealgebra.relations.Select
oralgebra.relations.SetCombination
in order to add a local WITH-clause for somealgebra.relations.With
objects given in a tuple attribute, saywith_relations
.
The queries.dql.Select
object should then make use of this algebra.relations.WithClosure
object, to ensure that all the WITH-clauses are closed in the executable query.