module Database.Beam.Query.Operator
( SqlBool
, (&&.), (||.), not_, div_, mod_
, (&&?.), (||?.), sqlNot_
, like_, similarTo_
, like_', similarTo_'
, concat_
) where
import Database.Beam.Backend.SQL
import Database.Beam.Query.Internal
import Control.Applicative
import qualified Data.Text as T
data SqlBool
(&&.) :: BeamSqlBackend be
=> QGenExpr context be s Bool
-> QGenExpr context be s Bool
-> QGenExpr context be s Bool
&&. :: forall be context s.
BeamSqlBackend be =>
QGenExpr context be s Bool
-> QGenExpr context be s Bool -> QGenExpr context be s Bool
(&&.) = forall be context s a b c.
BeamSqlBackend be =>
(BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s a
-> QGenExpr context be s b
-> QGenExpr context be s c
qBinOpE forall expr. IsSql92ExpressionSyntax expr => expr -> expr -> expr
andE
(||.) :: BeamSqlBackend be
=> QGenExpr context be s Bool
-> QGenExpr context be s Bool
-> QGenExpr context be
s Bool
||. :: forall be context s.
BeamSqlBackend be =>
QGenExpr context be s Bool
-> QGenExpr context be s Bool -> QGenExpr context be s Bool
(||.) = forall be context s a b c.
BeamSqlBackend be =>
(BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s a
-> QGenExpr context be s b
-> QGenExpr context be s c
qBinOpE forall expr. IsSql92ExpressionSyntax expr => expr -> expr -> expr
orE
(&&?.) :: BeamSqlBackend be
=> QGenExpr context be s SqlBool
-> QGenExpr context be s SqlBool
-> QGenExpr context be s SqlBool
&&?. :: forall be context s.
BeamSqlBackend be =>
QGenExpr context be s SqlBool
-> QGenExpr context be s SqlBool -> QGenExpr context be s SqlBool
(&&?.) = forall be context s a b c.
BeamSqlBackend be =>
(BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s a
-> QGenExpr context be s b
-> QGenExpr context be s c
qBinOpE forall expr. IsSql92ExpressionSyntax expr => expr -> expr -> expr
andE
(||?.) :: BeamSqlBackend be
=> QGenExpr context be s SqlBool
-> QGenExpr context be s SqlBool
-> QGenExpr context be s SqlBool
||?. :: forall be context s.
BeamSqlBackend be =>
QGenExpr context be s SqlBool
-> QGenExpr context be s SqlBool -> QGenExpr context be s SqlBool
(||?.) = forall be context s a b c.
BeamSqlBackend be =>
(BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s a
-> QGenExpr context be s b
-> QGenExpr context be s c
qBinOpE forall expr. IsSql92ExpressionSyntax expr => expr -> expr -> expr
orE
infixr 3 &&., &&?.
infixr 2 ||., ||?.
like_
:: (BeamSqlBackendIsString be text, BeamSqlBackend be)
=> QGenExpr ctxt be s text
-> QGenExpr ctxt be s text
-> QGenExpr ctxt be s Bool
like_ :: forall be text ctxt s.
(BeamSqlBackendIsString be text, BeamSqlBackend be) =>
QGenExpr ctxt be s text
-> QGenExpr ctxt be s text -> QGenExpr ctxt be s Bool
like_ = forall be left right ctxt s.
(BeamSqlBackendIsString be left, BeamSqlBackendIsString be right,
BeamSqlBackend be) =>
QGenExpr ctxt be s left
-> QGenExpr ctxt be s right -> QGenExpr ctxt be s Bool
like_'
like_'
:: ( BeamSqlBackendIsString be left
, BeamSqlBackendIsString be right
, BeamSqlBackend be
)
=> QGenExpr ctxt be s left
-> QGenExpr ctxt be s right
-> QGenExpr ctxt be s Bool
like_' :: forall be left right ctxt s.
(BeamSqlBackendIsString be left, BeamSqlBackendIsString be right,
BeamSqlBackend be) =>
QGenExpr ctxt be s left
-> QGenExpr ctxt be s right -> QGenExpr ctxt be s Bool
like_' (QExpr TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
scrutinee) (QExpr TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
search) =
forall context be s t.
(TablePrefix -> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s t
QExpr (forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 forall expr. IsSql92ExpressionSyntax expr => expr -> expr -> expr
likeE TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
scrutinee TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
search)
similarTo_
:: (BeamSqlBackendIsString be text, BeamSql99ExpressionBackend be)
=> QGenExpr ctxt be s text
-> QGenExpr ctxt be s text
-> QGenExpr ctxt be s text
similarTo_ :: forall be text ctxt s.
(BeamSqlBackendIsString be text, BeamSql99ExpressionBackend be) =>
QGenExpr ctxt be s text
-> QGenExpr ctxt be s text -> QGenExpr ctxt be s text
similarTo_ = forall be left right ctxt s.
(BeamSqlBackendIsString be left, BeamSqlBackendIsString be right,
BeamSql99ExpressionBackend be) =>
QGenExpr ctxt be s left
-> QGenExpr ctxt be s right -> QGenExpr ctxt be s left
similarTo_'
similarTo_'
:: ( BeamSqlBackendIsString be left
, BeamSqlBackendIsString be right
, BeamSql99ExpressionBackend be
)
=> QGenExpr ctxt be s left
-> QGenExpr ctxt be s right
-> QGenExpr ctxt be s left
similarTo_' :: forall be left right ctxt s.
(BeamSqlBackendIsString be left, BeamSqlBackendIsString be right,
BeamSql99ExpressionBackend be) =>
QGenExpr ctxt be s left
-> QGenExpr ctxt be s right -> QGenExpr ctxt be s left
similarTo_' (QExpr TablePrefix -> BeamSqlBackendExpressionSyntax be
scrutinee) (QExpr TablePrefix -> BeamSqlBackendExpressionSyntax be
search) =
forall context be s t.
(TablePrefix -> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s t
QExpr (forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 forall expr. IsSql99ExpressionSyntax expr => expr -> expr -> expr
similarToE TablePrefix -> BeamSqlBackendExpressionSyntax be
scrutinee TablePrefix -> BeamSqlBackendExpressionSyntax be
search)
infix 4 `like_`, `similarTo_`
not_ :: forall be context s
. BeamSqlBackend be
=> QGenExpr context be s Bool
-> QGenExpr context be s Bool
not_ :: forall be context s.
BeamSqlBackend be =>
QGenExpr context be s Bool -> QGenExpr context be s Bool
not_ (QExpr TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
a) = forall context be s t.
(TablePrefix -> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s t
QExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall expr. IsSql92ExpressionSyntax expr => expr -> expr
notE TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
a)
sqlNot_ :: forall be context s
. BeamSqlBackend be
=> QGenExpr context be s SqlBool
-> QGenExpr context be s SqlBool
sqlNot_ :: forall be context s.
BeamSqlBackend be =>
QGenExpr context be s SqlBool -> QGenExpr context be s SqlBool
sqlNot_ (QExpr TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
a) = forall context be s t.
(TablePrefix -> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s t
QExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall expr. IsSql92ExpressionSyntax expr => expr -> expr
notE TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
a)
div_ :: (Integral a, BeamSqlBackend be)
=> QGenExpr context be s a -> QGenExpr context be s a
-> QGenExpr context be s a
div_ :: forall a be context s.
(Integral a, BeamSqlBackend be) =>
QGenExpr context be s a
-> QGenExpr context be s a -> QGenExpr context be s a
div_ = forall be context s a b c.
BeamSqlBackend be =>
(BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s a
-> QGenExpr context be s b
-> QGenExpr context be s c
qBinOpE forall expr. IsSql92ExpressionSyntax expr => expr -> expr -> expr
divE
infixl 7 `div_`, `mod_`
mod_ :: (Integral a, BeamSqlBackend be)
=> QGenExpr context be s a -> QGenExpr context be s a
-> QGenExpr context be s a
mod_ :: forall a be context s.
(Integral a, BeamSqlBackend be) =>
QGenExpr context be s a
-> QGenExpr context be s a -> QGenExpr context be s a
mod_ = forall be context s a b c.
BeamSqlBackend be =>
(BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be
-> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s a
-> QGenExpr context be s b
-> QGenExpr context be s c
qBinOpE forall expr. IsSql92ExpressionSyntax expr => expr -> expr -> expr
modE
concat_ :: BeamSql99ConcatExpressionBackend be
=> [ QGenExpr context be s T.Text ] -> QGenExpr context be s T.Text
concat_ :: forall be context s.
BeamSql99ConcatExpressionBackend be =>
[QGenExpr context be s TablePrefix]
-> QGenExpr context be s TablePrefix
concat_ [QGenExpr context be s TablePrefix]
es = forall context be s t.
(TablePrefix -> BeamSqlBackendExpressionSyntax be)
-> QGenExpr context be s t
QExpr (forall expr. IsSql99ConcatExpressionSyntax expr => [expr] -> expr
concatE forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (\(QExpr TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
e) -> TablePrefix
-> Sql92SelectTableExpressionSyntax
(Sql92SelectSelectTableSyntax
(Sql92SelectSyntax (BeamSqlBackendSyntax be)))
e) [QGenExpr context be s TablePrefix]
es)