hpqtypes-1.3.2: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell98

Database.PostgreSQL.PQTypes.Composite

Synopsis

Documentation

newtype Composite a Source

Wrapper for (de)serializing composite types.

Constructors

Composite a 

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.

Methods

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.

Methods

fromComposite :: t -> CompositeRow t Source

Convert composite type to its intermediate representation.