Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type family Column a where ...
- data Nullable a
- null :: Column (Nullable a)
- isNull :: Column (Nullable a) -> Column PGBool
- unsafeCast :: String -> Field_ n' a -> Field_ n' b
- unsafeCoerceColumn :: Field_ n a -> Field_ n' b
- unsafeCompositeField :: Field_ n a -> String -> Field_ n' b
- null :: Column (Nullable a)
- isNull :: Column (Nullable a) -> Column PGBool
- joinNullable :: Column (Nullable (Nullable a)) -> Column (Nullable a)
Column
type family Column a where ... Source #
Do not use. Use Field
instead. Will be removed in a later
version.
Column (Nullable a) = FieldNullable a | |
Column a = Field a |
Working with NULL
isNull :: Column (Nullable a) -> Column PGBool Source #
TRUE
if the value of the column is NULL
, FALSE
otherwise.
Unsafe operations
unsafeCast :: String -> Field_ n' a -> Field_ n' b Source #
Cast a column to any other type. Implements Postgres's ::
or
CAST( ... AS ... )
operations. This is safe for some
conversions, such as uuid to text.
unsafeCoerceColumn :: Field_ n a -> Field_ n' b Source #
Treat a Column
as though it were of a different type. If such
a treatment is not valid then Postgres may fail with an error at
SQL run time.