hpqtypes-1.2.4: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell98

Database.PostgreSQL.PQTypes.FromSQL

Synopsis

Documentation

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

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

Associated Types

type PQBase t :: * Source

Base type (used by libpqtypes).

Methods

fromSQL Source

Arguments

:: Maybe (PQBase t)

base value (Nothing if NULL was delivered)

-> IO t 

Convert value of base type to target one.

Instances

FromSQL Bool 
FromSQL Char 
FromSQL Double 
FromSQL Float 
FromSQL Int16 
FromSQL Int32 
FromSQL Int64 
FromSQL Word8 
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.

FromSQL ByteString 
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.

FromSQL LocalTime 
FromSQL ZonedTime 
FromSQL TimeOfDay 
FromSQL UTCTime 
FromSQL Day 
FromSQL Interval 
FromSQL t => FromSQL (Maybe t) 
CompositeFromSQL t => FromSQL (Composite t) 
FromSQL (Binary ByteString) 
CompositeFromSQL t => FromSQL (CompositeArray2 t) 
FromSQL t => FromSQL (Array2 t) 
CompositeFromSQL t => FromSQL (CompositeArray1 t) 
FromSQL t => FromSQL (Array1 t)