opaleye-0.9.2.0: An SQL-generating DSL targeting PostgreSQL
Safe HaskellNone
LanguageHaskell2010

Opaleye.Column

Description

Do not use. Will be deprecated in version 0.10. Use Opaleye.Field instead.

Functions for working directly with Columns.

Please note that numeric Column types are instances of Num, so you can use *, /, +, - on them.

Synopsis

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

data Nullable a Source #

Only used within a Column, to indicate that it can be NULL. For example, a Column (Nullable SqlText) can be NULL but a Column SqlText cannot.

null :: Column (Nullable a) Source #

A NULL of any type

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.

Entire module

null :: Column (Nullable a) Source #

A NULL of any type

isNull :: Column (Nullable a) -> Column PGBool Source #

TRUE if the value of the column is NULL, FALSE otherwise.