Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.PostgreSQL.PQTypes.Composite
- 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.
Constructors
Composite a |
unComposite :: Composite a -> a #
Extract underlying value.
type family CompositeRow t :: * #
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 #
Class which represents "from SQL to composite" transformation.
Minimal complete definition
class (PQFormat t, ToRow (CompositeRow t)) => CompositeToSQL t where #
Class which represents "from composite to SQL" transformation.
Minimal complete definition
Methods
fromComposite :: t -> CompositeRow t #
Convert composite type to its intermediate representation.