-
I would like to have a function with the following signature ListTable Expr (f Expr) -> f Expr -> Expr Bool which 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? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Your best option is probably going to be using |
Beta Was this translation helpful? Give feedback.
-
Thanks @ocharles for the answer. I hoped there would be a way without ending in the |
Beta Was this translation helpful? Give feedback.
-
Unfortunately it will probably be quite difficult, due to what |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
Your best option is probably going to be using
catListTable
to convert aListTable
to aQuery
of all of its rows, and then usingexists
to test if the given row is in the list. This won't quite be the type you want, as this will pull you into theQuery
monad. 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!