| 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
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.
The name Column will be replaced by Field in version 0.7.
There already exists a Field type family to help smooth the
transition. We recommend that you use Field_, Field or
FieldNullable instead of Column everywhere that it is
sufficient.
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)) Source # | |
| Default NullMaker (Column (Nullable a)) (Column (Nullable a)) Source # | |
| Default ToFields haskell (Column sql) => Default ToFields (Maybe haskell) (Column (Nullable sql)) Source # | |
| IsSqlType a => IsSqlType (Nullable a) Source # | |
Defined in Opaleye.Internal.PGTypes Methods showPGType :: proxy (Nullable a) -> String Source # showSqlType :: proxy (Nullable a) -> String Source # | |
| PGOrd a => PGOrd (Nullable a) Source # | |
Defined in Opaleye.Order | |
| DefaultFromField a b => QueryRunnerColumnDefault (Nullable a) (Maybe b) Source # | |
Defined in Opaleye.Internal.RunQuery | |
| 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 #