hpqtypes-1.2.2: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell98

Database.PostgreSQL.PQTypes.SQL.Class

Synopsis

Documentation

data SomeSQL Source

Container for SQL-like type storage.

Constructors

forall sql . IsSQL sql => SomeSQL sql 

class Show sql => IsSQL sql where Source

Class representing "SQLness" of a given type.

Methods

someSQL :: sql -> SomeSQL Source

Convert sql to SomeSQL.

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 
(Show row, ToRow row) => IsSQL (RawSQL row) 

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