Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class SqlAssignment a b c where
- class SqlBoolean a where
- class SqlBoolean a => SqlBooleanNot a where
- not_ :: a -> a
- class SqlComparison a b c | c a -> b, c b -> a, a b -> c where
- type family NotSqlExprEq rec typ' typ :: Constraint where ...
- type NotSqlExprEqMessage rec typ = (((('Text "You used a bare `" :<>: 'ShowType (EntityField rec typ)) :<>: 'Text "` field.") :$$: 'Text "If you're writing a Persistent expression, you don't need to use `val`.") :$$: 'Text "If you're writing an esqueleto expression, you need to project from a ") :$$: 'Text "table variable, like: e ^. FooName"
- (/=.) :: SqlComparison a b c => a -> b -> c
Documentation
class SqlAssignment a b c where Source #
A class for assigning a value in SQL, shared among the persistent
and
esqueleto
libraries.
Instances
(PersistField typ, field ~ EntityField rec typ', typ ~ typ') => SqlAssignment field typ (Update rec) Source # | |
(PersistEntity rec, PersistField typ, field ~ EntityField rec typ) => SqlAssignment field (SqlExpr (Value typ)) (SqlExpr (Entity rec) -> SqlExpr Update) Source # | |
Defined in Database.Esqueleto.Compat.Operators (=.) :: field -> SqlExpr (Value typ) -> SqlExpr (Entity rec) -> SqlExpr Update Source # (-=.) :: field -> SqlExpr (Value typ) -> SqlExpr (Entity rec) -> SqlExpr Update Source # (+=.) :: field -> SqlExpr (Value typ) -> SqlExpr (Entity rec) -> SqlExpr Update Source # (*=.) :: field -> SqlExpr (Value typ) -> SqlExpr (Entity rec) -> SqlExpr Update Source # |
class SqlBoolean a where Source #
A class for abstracting over Bool
-like operations.
Irritatingly, we can't have not_
in here, because persistent
actually
doesn't have such a function! That's why the SqlBooleanNot
class exists.
Instances
a ~ Bool => SqlBoolean (SqlExpr (Value a)) Source # |
The implementation uses the |
SqlBoolean [Filter k] Source # | This is a bit of a weird definition. Turns out, |
class SqlBoolean a => SqlBooleanNot a where Source #
Instances
a ~ Bool => SqlBooleanNot (SqlExpr (Value a)) Source # | |
(TypeError ('Text "`persistent` does not have a `not_` operator for filters. Instead, use the " :$$: 'Text "inverse operator, like `<.` instead of `>=.`.") :: Constraint) => SqlBooleanNot [Filter t] Source # | A |
class SqlComparison a b c | c a -> b, c b -> a, a b -> c where Source #
A class for comparing for equality in persistent
and esqueleto
. The
first two type parameters are the inputs to the binary operator, and the
final one is the result type.
(==.) :: a -> b -> c infix 4 Source #
(!=.) :: a -> b -> c infix 4 Source #
(>.) :: a -> b -> c infix 4 Source #
(>=.) :: a -> b -> c infix 4 Source #
Instances
type family NotSqlExprEq rec typ' typ :: Constraint where ... Source #
NotSqlExprEq rec typ' (SqlExpr (Value _)) = TypeError (NotSqlExprEqMessage rec typ') | |
NotSqlExprEq _ _ _ = () |
type NotSqlExprEqMessage rec typ = (((('Text "You used a bare `" :<>: 'ShowType (EntityField rec typ)) :<>: 'Text "` field.") :$$: 'Text "If you're writing a Persistent expression, you don't need to use `val`.") :$$: 'Text "If you're writing an esqueleto expression, you need to project from a ") :$$: 'Text "table variable, like: e ^. FooName" Source #
(/=.) :: SqlComparison a b c => a -> b -> c infix 4 Source #
An alias for !=.
, in keeping with the convention of having Haskell-ish
operators.