hpqtypes-1.5.1.1: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.FromSQL

Synopsis

Documentation

class (PQFormat t, Storable (PQBase t)) => FromSQL t where #

Class which represents "from SQL (libpqtypes) type to Haskell type" transformation.

Minimal complete definition

fromSQL

Associated Types

type PQBase t :: * #

Base type (used by libpqtypes).

Methods

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

Convert value of base type to target one.

Instances

FromSQL Bool # 

Associated Types

type PQBase Bool :: * #

Methods

fromSQL :: Maybe (PQBase Bool) -> IO Bool #

FromSQL Char # 

Associated Types

type PQBase Char :: * #

Methods

fromSQL :: Maybe (PQBase Char) -> IO Char #

FromSQL Double # 

Associated Types

type PQBase Double :: * #

FromSQL Float # 

Associated Types

type PQBase Float :: * #

Methods

fromSQL :: Maybe (PQBase Float) -> IO Float #

FromSQL Int16 # 

Associated Types

type PQBase Int16 :: * #

Methods

fromSQL :: Maybe (PQBase Int16) -> IO Int16 #

FromSQL Int32 # 

Associated Types

type PQBase Int32 :: * #

Methods

fromSQL :: Maybe (PQBase Int32) -> IO Int32 #

FromSQL Int64 # 

Associated Types

type PQBase Int64 :: * #

Methods

fromSQL :: Maybe (PQBase Int64) -> IO Int64 #

FromSQL Word8 # 

Associated Types

type PQBase Word8 :: * #

Methods

fromSQL :: Maybe (PQBase Word8) -> IO Word8 #

FromSQL ByteString # 

Associated Types

type PQBase ByteString :: * #

FromSQL ByteString # 

Associated Types

type PQBase ByteString :: * #

FromSQL String #

Assumes that source C string is UTF-8, so if you are working with a different encoding, you should not rely on this instance.

Associated Types

type PQBase String :: * #

FromSQL Text #

Assumes that source C string is UTF-8, so if you are working with a different encoding, you should not rely on this instance.

Associated Types

type PQBase Text :: * #

Methods

fromSQL :: Maybe (PQBase Text) -> IO Text #

FromSQL UTCTime #

FromSQL instance for ZonedTime doesn't exist because PostgreSQL doesn't provide zone offset information when returning timestamps with time zone in a binary format.

Associated Types

type PQBase UTCTime :: * #

FromSQL Text #

Assumes that source C string is UTF-8, so if you are working with a different encoding, you should not rely on this instance

Associated Types

type PQBase Text :: * #

Methods

fromSQL :: Maybe (PQBase Text) -> IO Text #

FromSQL LocalTime # 

Associated Types

type PQBase LocalTime :: * #

FromSQL TimeOfDay # 

Associated Types

type PQBase TimeOfDay :: * #

FromSQL Day # 

Associated Types

type PQBase Day :: * #

Methods

fromSQL :: Maybe (PQBase Day) -> IO Day #

FromSQL Interval # 

Associated Types

type PQBase Interval :: * #

FromSQL XML # 

Associated Types

type PQBase XML :: * #

Methods

fromSQL :: Maybe (PQBase XML) -> IO XML #

FromSQL t => FromSQL (Maybe t) # 

Associated Types

type PQBase (Maybe t) :: * #

Methods

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

FromSQL (JSONB ByteString) # 

Associated Types

type PQBase (JSONB ByteString) :: * #

FromSQL (JSONB ByteString) # 

Associated Types

type PQBase (JSONB ByteString) :: * #

FromSQL (JSONB Value) # 

Associated Types

type PQBase (JSONB Value) :: * #

FromSQL (JSON ByteString) # 

Associated Types

type PQBase (JSON ByteString) :: * #

FromSQL (JSON ByteString) # 

Associated Types

type PQBase (JSON ByteString) :: * #

FromSQL (JSON Value) # 

Associated Types

type PQBase (JSON Value) :: * #

Methods

fromSQL :: Maybe (PQBase (JSON Value)) -> IO (JSON Value) #

CompositeFromSQL t => FromSQL (Composite t) # 

Associated Types

type PQBase (Composite t) :: * #

Methods

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

CompositeFromSQL t => FromSQL (CompositeArray2 t) # 

Associated Types

type PQBase (CompositeArray2 t) :: * #

FromSQL t => FromSQL (Array2 t) # 

Associated Types

type PQBase (Array2 t) :: * #

Methods

fromSQL :: Maybe (PQBase (Array2 t)) -> IO (Array2 t) #

CompositeFromSQL t => FromSQL (CompositeArray1 t) # 

Associated Types

type PQBase (CompositeArray1 t) :: * #

FromSQL t => FromSQL (Array1 t) # 

Associated Types

type PQBase (Array1 t) :: * #

Methods

fromSQL :: Maybe (PQBase (Array1 t)) -> IO (Array1 t) #