Esqueleto now supports IN and EXISTS

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

Enjoy! =)

PS: I’ll try to post more in the future, so keep tuned =).

4 thoughts on “Esqueleto now supports IN and EXISTS”

  1. Isn’t this just the same as writing:

    select $ from $ \(person, post) ->
        where_ (post ^. BlogPostAuthorId ==. person ^. PersonId)
        return person
  2. select $
    from $ \(person, post) ->
    where_ (post ^. BlogPostAuthorId ==. person ^. PersonId)
    return person

  3. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *