Safe Haskell | None |
---|---|
Language | Haskell98 |
- null :: Column (Nullable a)
- isNull :: Column (Nullable a) -> Column PGBool
- matchNullable :: Column b -> (Column a -> Column b) -> Column (Nullable a) -> Column b
- fromNullable :: Column a -> Column (Nullable a) -> Column a
- toNullable :: Column a -> Column (Nullable a)
- maybeToNullable :: Maybe (Column a) -> Column (Nullable a)
- data Column a
- data Nullable a
- unsafeCast :: String -> Column a -> Column b
- unsafeCoerce :: Column a -> Column b
- unsafeCoerceColumn :: Column a -> Column b
- unsafeCompositeField :: Column a -> String -> Column b
Documentation
matchNullable :: Column b -> (Column a -> Column b) -> Column (Nullable a) -> Column b Source
If the Column (Nullable a)
is NULL then return the Column b
otherwise map the underlying Column a
using the provided
function.
The Opaleye equivalent of the maybe
function.
fromNullable :: Column a -> Column (Nullable a) -> Column a Source
If the Column (Nullable a)
is NULL then return the provided
Column a
otherwise return the underlying Column a
.
The Opaleye equivalent of the fromMaybe
function
maybeToNullable :: Maybe (Column a) -> Column (Nullable a) Source
If the argument is Nothing
return NULL otherwise return the
provided value coerced to a nullable type.
Default Constant haskell (Column sql) => Default Constant (Maybe haskell) (Column (Nullable sql)) | |
Default NullMaker (Column a) (Column (Nullable a)) | |
Default NullMaker (Column (Nullable a)) (Column (Nullable a)) | |
IsSqlType a => IsSqlType (Nullable a) Source | |
PGOrd a => PGOrd (Nullable a) Source | |
QueryRunnerColumnDefault a b => QueryRunnerColumnDefault (Nullable a) (Maybe b) Source |
unsafeCast :: String -> Column a -> Column b Source
Cast a column to any other type. This is safe for some conversions such as uuid to text.
unsafeCoerce :: Column a -> Column b Source
Deprecated: Use unsafeCoerceColumn instead
unsafeCoerceColumn :: Column a -> Column b Source
unsafeCompositeField :: Column a -> String -> Column b Source