hpqtypes-1.7.0.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.

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 # 
Instance details

Defined in Database.PostgreSQL.PQTypes.SQL

Methods

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

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

Defined in Database.PostgreSQL.PQTypes.SQL.Raw

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).