| 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
- pgFromInteger :: Integer -> Column a
- sqlFromInteger :: Integer -> Column a
- type SqlNum = PGNum
- class PGFractional a where
- pgFromRational :: Rational -> Column a
- sqlFromRational :: Rational -> Column a
- type SqlFractional = PGFractional
- class PGIntegral a
- type SqlIntegral = PGIntegral
- class PGString a where
- pgFromString :: String -> Column a
- sqlFromString :: String -> Column a
- type SqlString = PGString
Documentation
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) # | |
Defined in Opaleye.PGTypes | |
| PGOrd a => PGOrd (Nullable a) # | |
Defined in Opaleye.Order | |
| QueryRunnerColumnDefault a b => QueryRunnerColumnDefault (Nullable a) (Maybe b) # | |
Defined in Opaleye.Internal.RunQuery Methods queryRunnerColumnDefault :: QueryRunnerColumn (Nullable a) (Maybe b) # | |
| type Map Nulled (Column (Nullable a)) # | |
unsafeCoerceColumn :: Column a -> Column b #
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 #
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.
unsafeCompositeField :: Column a -> String -> Column b #
Minimal complete definition
Instances
| PGNum PGInt4 # | |
Defined in Opaleye.PGTypes | |
| PGNum PGInt8 # | |
Defined in Opaleye.PGTypes | |
| PGNum PGFloat8 # | |
Defined in Opaleye.PGTypes | |
class PGFractional a where #
Minimal complete definition
Instances
| PGFractional PGFloat8 # | |
Defined in Opaleye.PGTypes Methods pgFromRational :: Rational -> Column PGFloat8 # sqlFromRational :: Rational -> Column PGFloat8 # | |
type SqlFractional = PGFractional #
class PGIntegral a #
A dummy typeclass whose instances support integral operations.
Instances
| PGIntegral PGNumeric # | |
Defined in Opaleye.PGTypes | |
| PGIntegral PGInt2 # | |
Defined in Opaleye.PGTypes | |
| PGIntegral PGInt4 # | |
Defined in Opaleye.PGTypes | |
| PGIntegral PGInt8 # | |
Defined in Opaleye.PGTypes | |
type SqlIntegral = PGIntegral #
Minimal complete definition
Instances
| PGString PGCitext # | |
Defined in Opaleye.PGTypes | |
| PGString PGText # | |
Defined in Opaleye.PGTypes | |