|
I would like to have a function with the following signature ListTable Expr (f Expr) -> f Expr -> Expr Boolwhich checks whether the second argument is contained in the list table. Is this something which is achievable with the provided API? How could I do that? |
Replies: 4 comments
|
Your best option is probably going to be using |
|
Thanks @ocharles for the answer. I hoped there would be a way without ending in the |
|
Unfortunately it will probably be quite difficult, due to what |
|
I see, thanks for the clarification. For the moment I'm doing it at the Haskell level instead of at the database level. Not super performant, but it makes things easier at least |
Your best option is probably going to be using
catListTableto convert aListTableto aQueryof all of its rows, and then usingexiststo test if the given row is in the list. This won't quite be the type you want, as this will pull you into theQuerymonad. I'd also warn that this is likely to have quite poor performance (I doubt PostgreSQL will be able to use an index, for example), but I may be wrong!