Since version 0.2.9 that I’ve just released, esqueleto supports IN
and EXISTS
operators (and their negated counterparts). For example:
select $
from $ \person -> do
where_ $ exists $
from $ \post -> do
where_ (post ^. BlogPostAuthorId ==. person ^. PersonId)
return person
from $ \person -> do
where_ $ exists $
from $ \post -> do
where_ (post ^. BlogPostAuthorId ==. person ^. PersonId)
return person
Enjoy! =)
PS: I’ll try to post more in the future, so keep tuned =).
Isn’t this just the same as writing:
where_ (post ^. BlogPostAuthorId ==. person ^. PersonId)
return person
select $
from $ \(person, post) ->
where_ (post ^. BlogPostAuthorId ==. person ^. PersonId)
return person
Erik: I guess you can always simulate IN and EXISTS using joins, but the query may get uglier and/or more inefficient on your backend.
what is esqueleto?