module Database.Beam.Query.Operator
(
(&&.), (||.), not_, div_, mod_
, like_, similarTo_
, isTrue_, isNotTrue_
, isFalse_, isNotFalse_
, isUnknown_, isNotUnknown_
, concat_
) where
import Database.Beam.Backend.SQL
import Database.Beam.Query.Internal
import Control.Applicative
import qualified Data.Text as T
(&&.) :: IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s Bool
-> QGenExpr context syntax s Bool
-> QGenExpr context syntax s Bool
(&&.) = qBinOpE andE
(||.) :: IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s Bool
-> QGenExpr context syntax s Bool
-> QGenExpr context syntax s Bool
(||.) = qBinOpE orE
infixr 3 &&.
infixr 2 ||.
like_ ::
( IsSqlExpressionSyntaxStringType syntax text
, IsSql92ExpressionSyntax syntax ) =>
QExpr syntax s text -> QExpr syntax s text -> QExpr syntax s Bool
like_ (QExpr scrutinee) (QExpr search) =
QExpr (liftA2 likeE scrutinee search)
similarTo_ ::
( IsSqlExpressionSyntaxStringType syntax text
, IsSql99ExpressionSyntax syntax ) =>
QExpr syntax s text -> QExpr syntax s text -> QExpr syntax s text
similarTo_ (QExpr scrutinee) (QExpr search) =
QExpr (liftA2 similarToE scrutinee search)
not_ :: forall syntax context s.
IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s Bool
-> QGenExpr context syntax s Bool
not_ (QExpr a) = QExpr (fmap notE a)
div_ :: (Integral a, IsSql92ExpressionSyntax syntax)
=> QGenExpr context syntax s a -> QGenExpr context syntax s a
-> QGenExpr context syntax s a
div_ = qBinOpE divE
mod_ :: (Integral a, IsSql92ExpressionSyntax syntax)
=> QGenExpr context syntax s a -> QGenExpr context syntax s a
-> QGenExpr context syntax s a
mod_ = qBinOpE modE
isTrue_ :: IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s a -> QGenExpr context syntax s Bool
isTrue_ (QExpr s) = QExpr (fmap isTrueE s)
isNotTrue_ :: IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s a -> QGenExpr context syntax s Bool
isNotTrue_ (QExpr s) = QExpr (fmap isNotTrueE s)
isFalse_ :: IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s a -> QGenExpr context syntax s Bool
isFalse_ (QExpr s) = QExpr (fmap isFalseE s)
isNotFalse_ :: IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s a -> QGenExpr context syntax s Bool
isNotFalse_ (QExpr s) = QExpr (fmap isNotFalseE s)
isUnknown_ :: IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s a -> QGenExpr context syntax s Bool
isUnknown_ (QExpr s) = QExpr (fmap isUnknownE s)
isNotUnknown_ :: IsSql92ExpressionSyntax syntax
=> QGenExpr context syntax s a -> QGenExpr context syntax s Bool
isNotUnknown_ (QExpr s) = QExpr (fmap isNotUnknownE s)
concat_ :: IsSql99ConcatExpressionSyntax syntax
=> [ QGenExpr context syntax s T.Text ] -> QGenExpr context syntax s T.Text
concat_ es = QExpr (concatE <$> mapM (\(QExpr e) -> e) es)