Safe Haskell | None |
---|---|
Language | Haskell2010 |
Convenience facilities for working with nullable columns.
Synopsis
- type family NonNull a where ...
- type (:?~) a b = (NonNull a ~ NonNull b, SqlType (NonNull a), SqlType (NonNull b))
- nonNull :: SqlType a => Col s (Maybe a) -> Query s (Col s a)
- restrict' :: Col s (Maybe Bool) -> Query s ()
- (?!) :: forall s t a. SqlType a => Row s t -> Selector (NonNull t) a -> Col s (Coalesce (Maybe a))
- (?==) :: (a :?~ b, SqlType a) => Col s a -> Col s b -> Col s (Maybe Bool)
- (?/=) :: (a :?~ b, SqlType a) => Col s a -> Col s b -> Col s (Maybe Bool)
- (?>) :: (a :?~ b, SqlOrd (NonNull a)) => Col s a -> Col s b -> Col s (Maybe Bool)
- (?<) :: (a :?~ b, SqlOrd (NonNull a)) => Col s a -> Col s b -> Col s (Maybe Bool)
- (?>=) :: (a :?~ b, SqlOrd (NonNull a)) => Col s a -> Col s b -> Col s (Maybe Bool)
- (?<=) :: (a :?~ b, SqlOrd (NonNull a)) => Col s a -> Col s b -> Col s (Maybe Bool)
- (?+) :: (a :?~ b, Num (NonNull a)) => Col s a -> Col s b -> Col s (Maybe (NonNull a))
- (?-) :: (a :?~ b, Num (NonNull a)) => Col s a -> Col s b -> Col s (Maybe (NonNull a))
- (?*) :: (a :?~ b, Num (NonNull a)) => Col s a -> Col s b -> Col s (Maybe (NonNull a))
- (?/) :: (a :?~ b, Fractional (Col s (NonNull a))) => Col s a -> Col s b -> Col s (Maybe (NonNull a))
Documentation
type (:?~) a b = (NonNull a ~ NonNull b, SqlType (NonNull a), SqlType (NonNull b)) Source #
Two SQL types which are identical modulo nullability.
nonNull :: SqlType a => Col s (Maybe a) -> Query s (Col s a) Source #
Converts a nullable column into a non-nullable one, yielding the empty result set if the column is null.
restrict' :: Col s (Maybe Bool) -> Query s () Source #
Restrict a query using a nullable expression.
Equivalent to restrict . ifNull false
.
(?!) :: forall s t a. SqlType a => Row s t -> Selector (NonNull t) a -> Col s (Coalesce (Maybe a)) infixl 9 Source #
Selector indexing, overloaded to work on nullable as well as non-nullable rows.
(?>=) :: (a :?~ b, SqlOrd (NonNull a)) => Col s a -> Col s b -> Col s (Maybe Bool) infixl 4 Source #
(?<=) :: (a :?~ b, SqlOrd (NonNull a)) => Col s a -> Col s b -> Col s (Maybe Bool) infixl 4 Source #
(?+) :: (a :?~ b, Num (NonNull a)) => Col s a -> Col s b -> Col s (Maybe (NonNull a)) infixl 6 Source #
(?-) :: (a :?~ b, Num (NonNull a)) => Col s a -> Col s b -> Col s (Maybe (NonNull a)) infixl 6 Source #