| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Opaleye.Column
Description
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.
Equations
| Column (Nullable a) = FieldNullable a | |
| Column a = Field a |
Working with NULL
Only used within a Field_, to indicate that it can be NULL.
For example, a can be Field_ (Nullability SqlText)NULL but a
Field_ SqlText cannot.
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 Field_ 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.