postgresql-query-3.4.0: Sql interpolating quasiquote plus some kind of primitive ORM using it

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Query.SqlBuilder.Builder

Contents

Synopsis

Documentation

newtype SqlBuilder Source #

Builder wich can be effectively concatenated. Requires Connection inside for string quoting implemented in libpq. Builds two strings: query string and log string which may differ.

Running

runSqlBuilder :: Connection -> LogMasker -> SqlBuilder -> IO (Query, ByteString) Source #

Returns query string with log bytestring

Building

emptyB :: SqlBuilder Source #

Typed synonym of mempty

mkValue :: ToField a => a -> SqlBuilder Source #

Shorthand function to convert single field value to builder

mkMaskedValue :: ToField a => a -> SqlBuilder Source #

Shorthand function to convert single masked field value (which should not be shown in log)

Unsafe

sqlBuilderPure :: Builder -> SqlBuilder Source #

Lift pure bytestring builder to SqlBuilder. This is unsafe to use directly in your code.

sqlBuilderFromByteString :: ByteString -> SqlBuilder Source #

Unsafe function to make SqlBuilder from arbitrary ByteString. Does not perform any checks. Dont use it directly in your code unless you know what you are doing.