Safe Haskell | None |
---|---|
Language | Haskell98 |
- newtype Composite a = Composite a
- unComposite :: Composite a -> a
- type family CompositeRow t :: *
- class (PQFormat t, FromRow (CompositeRow t)) => CompositeFromSQL t where
- toComposite :: CompositeRow t -> IO t
- class (PQFormat t, ToRow (CompositeRow t)) => CompositeToSQL t where
- fromComposite :: t -> IO (CompositeRow t)
Documentation
Wrapper for (de)serializing composite types.
Functor Composite | |
Eq a => Eq (Composite a) | |
Ord a => Ord (Composite a) | |
Show a => Show (Composite a) | |
PQFormat t => PQFormat (Composite t) | |
CompositeFromSQL t => FromSQL (Composite t) | |
CompositeToSQL t => ToSQL (Composite t) | |
Typeable (* -> *) Composite | |
type PQBase (Composite t) = Ptr PGresult | |
type PQDest (Composite t) = PGparam |
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 -> IO 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 -> IO (CompositeRow t) Source
Convert composite type to its intermediate representation.