Rel8.Internal.Query.Filter
filter :: (a -> Expr Bool) -> a -> Query a Source #
filter f x will be a zero-row query when f x is False, and will return x unchanged when f x is True. This is similar to guard, but as the predicate is separate from the argument, it is easy to use in a pipeline of Query transformations.
filter f x
f x
False
x
True
guard
Query
where_ :: Expr Bool -> Query () Source #
Drop any rows that don't match a predicate. where_ expr is equivalent to the SQL WHERE expr.
where_ expr
WHERE expr