hpqtypes-1.5.1.1: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Composite

Synopsis

Documentation

newtype Composite a Source #

Wrapper for (de)serializing composite types.

Constructors

Composite a 

Instances

Functor Composite Source # 

Methods

fmap :: (a -> b) -> Composite a -> Composite b #

(<$) :: a -> Composite b -> Composite a #

Eq a => Eq (Composite a) Source # 

Methods

(==) :: Composite a -> Composite a -> Bool #

(/=) :: Composite a -> Composite a -> Bool #

Ord a => Ord (Composite a) Source # 
Show a => Show (Composite a) Source # 
PQFormat t => PQFormat (Composite t) Source # 
CompositeFromSQL t => FromSQL (Composite t) Source # 

Associated Types

type PQBase (Composite t) :: * Source #

Methods

fromSQL :: Maybe (PQBase (Composite t)) -> IO (Composite t) Source #

CompositeToSQL t => ToSQL (Composite t) Source # 

Associated Types

type PQDest (Composite t) :: * Source #

Methods

toSQL :: Composite t -> ParamAllocator -> (Ptr (PQDest (Composite t)) -> IO r) -> IO r Source #

type PQBase (Composite t) Source # 
type PQDest (Composite t) Source # 

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.

Minimal complete definition

toComposite

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.

Minimal complete definition

fromComposite

Methods

fromComposite :: t -> CompositeRow t Source #

Convert composite type to its intermediate representation.