haskell-beam / haskell-beam/beam

Feature Request: inQuery_

Open
#392 4 comments 1 reaction 1 assignee Claimed by @kmicklas View on GitHub
enhancement
Dominant language
Haskell
Stars
635
Forks
193
PR merge metrics
No merged PRs in 30d

Description

Sometimes it is desirable to be able to take queries that return a list of values and be able to use them in an "in" clause.

Example:
```sql
SELECT col1, col2 FROM tbl1 WHERE tbl1.col3 IN
(SELECT DISTINCT col3 FROM tbl1 WHERE cond1 AND cond2 LIMIT n)
FOR UPDATE SKIP LOCKED
```

Currently, `in_` requires you to have a list of `QGenExpr`s, It would be nice if a query could be placed on the right side of an `in_` like combinator instead of a haskell list.

I was hoping `subselect_` could fulfill my desires here, but it seems to only to take one argument, so I can't tell if it can be used for the above.

Is this something that would be possible?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.