opaleye-0.10.3.0: An SQL-generating DSL targeting PostgreSQL
Safe HaskellSafe-Inferred
LanguageHaskell2010

Opaleye.Column

Description

Deprecated: Use Opaleye.Field instead. Will be removed in version 0.11.

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 Field_, to indicate that it can be NULL. For example, a Field_ (Nullability SqlText) can be NULL but a Field_ 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 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.

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.