hpqtypes-1.7.0.0: 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 # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Composite

Methods

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

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

Eq a => Eq (Composite a) Source # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Composite

Methods

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

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

Ord a => Ord (Composite a) Source # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Composite

Show a => Show (Composite a) Source # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Composite

PQFormat t => PQFormat (Composite t) Source # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Composite

CompositeFromSQL t => FromSQL (Composite t) Source # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Composite

Associated Types

type PQBase (Composite t) :: Type Source #

Methods

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

CompositeToSQL t => ToSQL (Composite t) Source # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Composite

Associated Types

type PQDest (Composite t) :: Type Source #

Methods

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

type PQBase (Composite t) Source # 
Instance details

Defined in Database.PostgreSQL.PQTypes.Composite

type PQDest (Composite t) Source # 
Instance details

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.

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.