selda-0.5.1.0: Multi-backend, high-level EDSL for interacting with SQL databases.

Safe HaskellNone
LanguageHaskell2010

Database.Selda.Nullable

Description

Convenience facilities for working with nullable columns.

Synopsis

Documentation

type family NonNull a where ... Source #

Equations

NonNull (Maybe a) = a 
NonNull a = a 

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 #

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

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