Safe Haskell | Safe-Inferred |
---|---|

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 :: (Same s t, SqlType a) => Col s (Maybe a) -> Query t (Col t a)
- restrict' :: Same s t => Col s (Maybe Bool) -> Query t ()
- (?!) :: forall s t a. SqlType a => Row s t -> Selector (NonNull t) a -> Col s (Coalesce (Maybe a))
- (?==) :: (a :?~ b, SqlType a, Same s t) => Col s a -> Col t b -> Col s (Maybe Bool)
- (?/=) :: (a :?~ b, SqlType a, Same s t) => Col s a -> Col t b -> Col s (Maybe Bool)
- (?>) :: (a :?~ b, SqlOrd (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe Bool)
- (?<) :: (a :?~ b, SqlOrd (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe Bool)
- (?>=) :: (a :?~ b, SqlOrd (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe Bool)
- (?<=) :: (a :?~ b, SqlOrd (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe Bool)
- (?+) :: (a :?~ b, Num (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe (NonNull a))
- (?-) :: (a :?~ b, Num (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe (NonNull a))
- (?*) :: (a :?~ b, Num (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe (NonNull a))
- (?/) :: (a :?~ b, Fractional (Col s (NonNull a)), Same s t) => Col s a -> Col t 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 :: (Same s t, SqlType a) => Col s (Maybe a) -> Query t (Col t a) Source #

Converts a nullable column into a non-nullable one, yielding the empty result set if the column is null.

restrict' :: Same s t => Col s (Maybe Bool) -> Query t () 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, SqlType a, Same s t) => Col s a -> Col t b -> Col s (Maybe Bool) infixl 4 Source #

(?/=) :: (a :?~ b, SqlType a, Same s t) => Col s a -> Col t b -> Col s (Maybe Bool) infixl 4 Source #

(?>) :: (a :?~ b, SqlOrd (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe Bool) infixl 4 Source #

(?<) :: (a :?~ b, SqlOrd (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe Bool) infixl 4 Source #

(?>=) :: (a :?~ b, SqlOrd (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe Bool) infixl 4 Source #

(?<=) :: (a :?~ b, SqlOrd (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe Bool) infixl 4 Source #

(?+) :: (a :?~ b, Num (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe (NonNull a)) infixl 6 Source #

(?-) :: (a :?~ b, Num (NonNull a), Same s t) => Col s a -> Col t b -> Col s (Maybe (NonNull a)) infixl 6 Source #