Safe Haskell | None |
---|
This module has common SQL functions and operators which are supported in the most SQL databases
- like :: (SqlDb db, ExpressionOf db r a a', IsString a') => a -> String -> Cond db r
- notLike :: (SqlDb db, ExpressionOf db r a a', IsString a') => a -> String -> Cond db r
- in_ :: (SqlDb db, Expression db r a, Expression db r b, PrimitivePersistField b, Unifiable a b) => a -> [b] -> Cond db r
- notIn_ :: (SqlDb db, Expression db r a, Expression db r b, PrimitivePersistField b, Unifiable a b) => a -> [b] -> Cond db r
- lower :: (SqlDb db, ExpressionOf db r a a', IsString a') => a -> Expr db r a'
- upper :: (SqlDb db, ExpressionOf db r a a', IsString a') => a -> Expr db r a'
- case_ :: (SqlDb db, ExpressionOf db r a a', ExpressionOf db r b a') => [(Cond db r, a)] -> b -> Expr db r a'
- class (DbDescriptor db, QueryRaw db ~ Snippet db) => SqlDb db where
- append :: (ExpressionOf db r a String, ExpressionOf db r b String) => a -> b -> Expr db r String
- signum' :: (ExpressionOf db r x a, Num a) => x -> Expr db r a
- quotRem' :: (ExpressionOf db r x a, ExpressionOf db r y a, Integral a) => x -> y -> (Expr db r a, Expr db r a)
- equalsOperator :: RenderS db r -> RenderS db r -> RenderS db r
- notEqualsOperator :: RenderS db r -> RenderS db r -> RenderS db r
- cot :: (FloatingSqlDb db, ExpressionOf db r a a', Floating a') => a -> Expr db r a'
- atan2 :: RealFloat a => a -> a -> a
- radians :: (FloatingSqlDb db, ExpressionOf db r a a', Floating a') => a -> Expr db r a'
- degrees :: (FloatingSqlDb db, ExpressionOf db r a a', Floating a') => a -> Expr db r a'
Documentation
in_ :: (SqlDb db, Expression db r a, Expression db r b, PrimitivePersistField b, Unifiable a b) => a -> [b] -> Cond db rSource
notIn_ :: (SqlDb db, Expression db r a, Expression db r b, PrimitivePersistField b, Unifiable a b) => a -> [b] -> Cond db rSource
:: (SqlDb db, ExpressionOf db r a a', ExpressionOf db r b a') | |
=> [(Cond db r, a)] | Conditions |
-> b | It is returned when none of conditions is true |
-> Expr db r a' |
class (DbDescriptor db, QueryRaw db ~ Snippet db) => SqlDb db whereSource
This class distinguishes databases which support SQL-specific expressions. It contains ad hoc members for features whose syntax differs across the databases.
append :: (ExpressionOf db r a String, ExpressionOf db r b String) => a -> b -> Expr db r StringSource
signum' :: (ExpressionOf db r x a, Num a) => x -> Expr db r aSource
quotRem' :: (ExpressionOf db r x a, ExpressionOf db r y a, Integral a) => x -> y -> (Expr db r a, Expr db r a)Source
equalsOperator :: RenderS db r -> RenderS db r -> RenderS db rSource
notEqualsOperator :: RenderS db r -> RenderS db r -> RenderS db rSource
cot :: (FloatingSqlDb db, ExpressionOf db r a a', Floating a') => a -> Expr db r a'Source
atan2 :: RealFloat a => a -> a -> a
a version of arctangent taking two real floating-point arguments.
For real floating x
and y
,
computes the angle
(from the positive x-axis) of the vector from the origin to the
point atan2
y x(x,y)
.
returns a value in the range [atan2
y x-pi
,
pi
]. It follows the Common Lisp semantics for the origin when
signed zeroes are supported.
, with atan2
y 1y
in a type
that is RealFloat
, should return the same value as
.
A default definition of atan
yatan2
is provided, but implementors
can provide a more accurate implementation.
radians :: (FloatingSqlDb db, ExpressionOf db r a a', Floating a') => a -> Expr db r a'Source
degrees :: (FloatingSqlDb db, ExpressionOf db r a a', Floating a') => a -> Expr db r a'Source