Open jhickner opened 8 years ago
In SQL, a query like this is valid:
update people set active = false where (id, name) not in ((1, 'Jason'), (3, 'Fred'))
But I'm having trouble constructing that with esqueleto. Here's what I've tried:
update pairs $ p -> do set p [ PersonActive =. val False ] where_ $ (p ^. PersonId, p ^. PersonName) `notIn` valList pairs
where pairs is [ (PersonId, Text) ]
pairs
[ (PersonId, Text) ]
But that throws a lot of errors, starting with:
Couldn't match type ‘SqlExpr’ with ‘(,) (SqlExpr (E.Value (Key PersonId)))’
Is it possible to construct this type of query in esqueleto?
Thanks!
Currently that's not possible. If you really need it, you may try playing with in_'s implementation (see here and here).
in_
In SQL, a query like this is valid:
But I'm having trouble constructing that with esqueleto. Here's what I've tried:
where
pairs
is[ (PersonId, Text) ]
But that throws a lot of errors, starting with:
Is it possible to construct this type of query in esqueleto?
Thanks!