| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Opaleye.Internal.Column
Synopsis
- newtype Column pgType = Column PrimExpr
- data Nullable a = Nullable
- unColumn :: Column a -> PrimExpr
- unsafeCoerceColumn :: Column a -> Column b
- unsafeCast :: String -> Column a -> Column b
- unsafeCompositeField :: Column a -> String -> Column b
- binOp :: BinOp -> Column a -> Column b -> Column c
- unOp :: UnOp -> Column a -> Column b
- unsafeCase_ :: [(Column pgBool, Column a)] -> Column a -> Column a
- unsafeIfThenElse :: Column pgBool -> Column a -> Column a -> Column a
- unsafeGt :: Column a -> Column a -> Column pgBool
- unsafeEq :: Column a -> Column a -> Column pgBool
- class PGNum a where
- type SqlNum = PGNum
- class PGFractional a where
- type SqlFractional = PGFractional
- class PGIntegral a
- type SqlIntegral = PGIntegral
- class PGString a where
- type SqlString = PGString
Documentation
newtype Column pgType Source #
A column of a Query, of type pgType. For example Column
PGInt4 is an int4 column and a Column PGText is a text
column.
Do not use the Show instance of Column. It is considered
deprecated and will be removed in version 0.7.
Instances
Only used within a Column, to indicate that it can be NULL.
For example, a Column (Nullable PGText) can be NULL but a
Column PGText cannot.
Constructors
| Nullable |
Instances
| Default NullMaker (Column a) (Column (Nullable a)) # | |
| Default NullMaker (Column (Nullable a)) (Column (Nullable a)) # | |
| Default Constant haskell (Column sql) => Default Constant (Maybe haskell) (Column (Nullable sql)) # | |
| IsSqlType a => IsSqlType (Nullable a) Source # | |
Defined in Opaleye.PGTypes Methods showPGType :: proxy (Nullable a) -> String Source # showSqlType :: proxy (Nullable a) -> String Source # | |
| PGOrd a => PGOrd (Nullable a) Source # | |
Defined in Opaleye.Order | |
| QueryRunnerColumnDefault a b => QueryRunnerColumnDefault (Nullable a) (Maybe b) Source # | |
Defined in Opaleye.Internal.RunQuery Methods queryRunnerColumnDefault :: QueryRunnerColumn (Nullable a) (Maybe b) Source # | |
| type Map Nulled (Column (Nullable a)) Source # | |
unsafeCoerceColumn :: Column a -> Column 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.
unsafeCast :: String -> Column a -> Column 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.
Minimal complete definition
Instances
| PGNum PGInt4 Source # | |
Defined in Opaleye.PGTypes | |
| PGNum PGInt8 Source # | |
Defined in Opaleye.PGTypes | |
| PGNum PGFloat8 Source # | |
Defined in Opaleye.PGTypes | |
class PGFractional a where Source #
Minimal complete definition
Methods
pgFromRational :: Rational -> Column a Source #
sqlFromRational :: Rational -> Column a Source #
Instances
| PGFractional PGFloat8 Source # | |
Defined in Opaleye.PGTypes | |
type SqlFractional = PGFractional Source #
class PGIntegral a Source #
A dummy typeclass whose instances support integral operations.
Instances
| PGIntegral PGNumeric Source # | |
Defined in Opaleye.PGTypes | |
| PGIntegral PGInt2 Source # | |
Defined in Opaleye.PGTypes | |
| PGIntegral PGInt4 Source # | |
Defined in Opaleye.PGTypes | |
| PGIntegral PGInt8 Source # | |
Defined in Opaleye.PGTypes | |
type SqlIntegral = PGIntegral Source #