hpqtypes-1.4.3: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell98

Database.PostgreSQL.PQTypes.ToSQL

Synopsis

Documentation

type ParamAllocator = forall r. (Ptr PGparam -> IO r) -> IO r Source

alloca-like producer of PGparam objects.

class PQFormat t => ToSQL t where Source

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

Associated Types

type PQDest t :: * Source

Destination type (used by libpqtypes).

Methods

toSQL Source

Arguments

:: t

Value to be put.

-> ParamAllocator

PGparam allocator.

-> (Ptr (PQDest t) -> IO r)

Continuation that puts converted value into inner PGparam.

-> IO r 

Put supplied value into inner PGparam.

Instances

ToSQL Bool Source 
ToSQL Char Source 
ToSQL Double Source 
ToSQL Float Source 
ToSQL Int Source 
ToSQL Int16 Source 
ToSQL Int32 Source 
ToSQL Int64 Source 
ToSQL Word8 Source 
ToSQL String Source

Encodes underlying C string as UTF-8, so if you are working with a different encoding, you should not rely on this instance.

ToSQL ByteString Source 
ToSQL ByteString Source 
ToSQL Text Source

Encodes underlying C string as UTF-8, so if you are working with a different encoding, you should not rely on this instance.

ToSQL UTCTime Source 
ToSQL Text Source

Encodes underlying C string as UTF-8, so if you are working with a different encoding, you should not rely on this instance.

ToSQL LocalTime Source 
ToSQL ZonedTime Source 
ToSQL TimeOfDay Source 
ToSQL Day Source 
ToSQL Interval Source 
ToSQL XML Source 
ToSQL t => ToSQL (Maybe t) Source 
ToSQL (JSONB ByteString) Source 
ToSQL (JSONB ByteString) Source 
ToSQL (JSONB Value) Source 
ToSQL (JSON ByteString) Source 
ToSQL (JSON ByteString) Source 
ToSQL (JSON Value) Source 
CompositeToSQL t => ToSQL (Composite t) Source 
ToSQL (Binary ByteString) Source 
CompositeToSQL t => ToSQL (CompositeArray2 t) Source 
ToSQL t => ToSQL (Array2 t) Source 
CompositeToSQL t => ToSQL (CompositeArray1 t) Source 
ToSQL t => ToSQL (Array1 t) Source 

put :: Storable t => t -> (Ptr t -> IO r) -> IO r Source

Function that abstracts away common elements of most ToSQL instance definitions to make them easier to write and less verbose.