Adds example usage of 'in_' operator

This commit is contained in:
Richard Zetterberg 2015-12-31 17:10:18 +01:00
parent 918ed82154
commit a8dd97354e

View File

@ -456,7 +456,25 @@ class (Functor query, Applicative query, Monad query) =>
-- /Since: 2.2.12/
justList :: expr (ValueList typ) -> expr (ValueList (Maybe typ))
-- | @IN@ operator.
-- | @IN@ operator. For example if you want to select all @Person@s by a list
-- of IDs:
--
-- @
-- SELECT *
-- FROM Person
-- WHERE Person.id IN (?)
-- @
--
-- In @esqueleto@, we may write the same query above as:
--
-- @
-- select $
-- 'from' $ \\person -> do
-- 'where_' $ person '^.' PersonId `in_` 'valList' personIds
-- return person
-- @
--
-- Where @personIds@ is of type @[Key Person]@.
in_ :: PersistField typ => expr (Value typ) -> expr (ValueList typ) -> expr (Value Bool)
-- | @NOT IN@ operator.