Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Composite a = Composite a
- unComposite :: Composite a -> a
- type family CompositeRow t :: *
- class (PQFormat t, FromRow (CompositeRow t)) => CompositeFromSQL t where
- class (PQFormat t, ToRow (CompositeRow t)) => CompositeToSQL t where
Documentation
Wrapper for (de)serializing composite types.
Instances
Functor Composite Source # | |
Eq a => Eq (Composite a) Source # | |
Ord a => Ord (Composite a) Source # | |
Defined in Database.PostgreSQL.PQTypes.Composite | |
Show a => Show (Composite a) Source # | |
PQFormat t => PQFormat (Composite t) Source # | |
Defined in Database.PostgreSQL.PQTypes.Composite | |
CompositeFromSQL t => FromSQL (Composite t) Source # | |
CompositeToSQL t => ToSQL (Composite t) Source # | |
type PQBase (Composite t) Source # | |
Defined in Database.PostgreSQL.PQTypes.Composite | |
type PQDest (Composite t) Source # | |
Defined in Database.PostgreSQL.PQTypes.Composite |
unComposite :: Composite a -> a Source #
Extract underlying value.
type family CompositeRow t :: * Source #
Type function which maps composite type to its intermediate representation as a tuple (row) of Haskell types that correspond to PostgreSQL types in composite type definition.
As an example, consider the type defined as (a INTEGER, b DATE). Then its CompositeRow instance could be (Maybe Int32, Maybe Day), (Maybe Int32, Day), (Int32, Maybe Day) or (Int32, Day).
class (PQFormat t, FromRow (CompositeRow t)) => CompositeFromSQL t where Source #
Class which represents "from SQL to composite" transformation.
toComposite :: CompositeRow t -> t Source #
Convert composite row to destination type.
class (PQFormat t, ToRow (CompositeRow t)) => CompositeToSQL t where Source #
Class which represents "from composite to SQL" transformation.
fromComposite :: t -> CompositeRow t Source #
Convert composite type to its intermediate representation.