hpqtypes-1.5.2.0: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.SQL.Class

Synopsis

Documentation

data SomeSQL Source #

Container for SQL-like type storage.

Constructors

IsSQL sql => SomeSQL sql 

class Show sql => IsSQL sql where Source #

Class representing "SQLness" of a given type.

Minimal complete definition

withSQL

Methods

withSQL Source #

Arguments

:: sql 
-> ParamAllocator

PGparam allocator.

-> (Ptr PGparam -> CString -> IO r)

Continuation which takes sql converted to libpqtypes specific representation, ie. PGparam object containing query parameters and C string containing the query itself.

-> IO r 

Convert sql to libpqtypes representation and pass it to supplied continuation (usually for execution).

Instances

IsSQL SQL Source # 

Methods

withSQL :: SQL -> ParamAllocator -> (Ptr PGparam -> CString -> IO r) -> IO r Source #

(Show row, ToRow row) => IsSQL (RawSQL row) Source # 

Methods

withSQL :: RawSQL row -> ParamAllocator -> (Ptr PGparam -> CString -> IO r) -> IO r Source #

unsafeSQL :: (IsSQL sql, IsString sql) => String -> sql Source #

Convert unsafely from String to sql (Note: reckless usage of this function may introduce security vulnerabilities such as proneness to SQL injection attacks).