haskell-beam / haskell-beam/beam
Requesting `subselectWith_` combinator
- Dominant language
- Haskell
- Stars
- 635
- Forks
- 193
- PR merge metrics
- No merged PRs in 30d
Description
As far as I can tell, currently the only way to write recursive CTEs with `beam` is to use the `selectWith` combinator, which can only happen at the "top-level". However, (at least) Postgres supports recursive CTEs inside subqueries as well:
``` SQL
SELECT *
FROM (
WITH RECURSIVE my_cte AS (
SELECT 1
UNION ALL
SELECT 1 WHERE FALSE
)
SELECT *
FROM my_cte
) AS t;
?column?
----------
1
(1 row)
```
Would it be possible to write a `subselectWith_` primitive, analogous to `subquery_` and `selectWith_` that allows CTEs inside subselects like this (without even exposing the `With` wrapper outside the subselect)?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.