@@ -24,6 +24,16 @@ filter :: (a -> Expr Bool) -> a -> Query a
24filter f a = a <$ where_ (f a)
24filter f a = a <$ where_ (f a)
27+-- | Drop any rows that don't match a predicate. @where_ expr@ is equivalent
28+-- to the SQL @WHERE expr@.
32+-- x <- values [ lit x | x <- [ 1..5 :: Int32 ] ]
33+-- where_ $ x >. lit 2
27where_ :: Expr Bool -> Query ()
37where_ :: Expr Bool -> Query ()
28where_ condition =
38where_ condition =
29 fromOpaleye $ lmap (\_ -> toColumn $ toPrimExpr condition) Opaleye.restrict
39 fromOpaleye $ lmap (\_ -> toColumn $ toPrimExpr condition) Opaleye.restrict