Hello! Is there a way to encode in Rel8 the following idiom?
SELECT ...
FROM table_name
WHERE
(condition1
OR EXISTS (<some query here>) -- this
OR ...)
More specifically, is there a way to use EXISTS in an Expr context? Currently exists seems to only work within Query, which makes it impossible to use it within a where_ clause
exists :: Query a -> Query (Expr Bool)
Is there a workaround for this at the moment? If not, are there any plans to implement this feature in the future?
For a little bit of context: in the project I'm currently working on we are trying to migrate from Hasql to Rel8 and a part of that is the conversion of filtering. The frontend sends potentially complex filters to the backend, which are then converted to an SQL expression that becomes part of a where_ clause. Hence the need to use exists within the Expr context.
Thanks for all the work you've put into this wonderful library!
Hello! Is there a way to encode in Rel8 the following idiom?
More specifically, is there a way to use
EXISTS
in anExpr
context? Currentlyexists
seems to only work withinQuery
, which makes it impossible to use it within awhere_
clauseIs there a workaround for this at the moment? If not, are there any plans to implement this feature in the future?
For a little bit of context: in the project I'm currently working on we are trying to migrate from Hasql to Rel8 and a part of that is the conversion of filtering. The frontend sends potentially complex filters to the backend, which are then converted to an SQL expression that becomes part of a
where_
clause. Hence the need to useexists
within theExpr
context.Thanks for all the work you've put into this wonderful library!