pg-store-0.4.0: Simple storage interface to PostgreSQL

Copyright(c) Ole Krüger 2016
LicenseBSD3
MaintainerOle Krüger <ole@vprsm.de>
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Store.Query.Builder

Description

 

Synopsis

Documentation

data QueryGenerator a Source #

Generator for queries, its type parameter hints the type needed to generate the attached values

assemble :: QueryGenerator a -> a -> Query r Source #

Assemble the query object.

assemblePrep :: ByteString -> QueryGenerator (Tuple p) -> PrepQuery p r Source #

Assemble for query preparation.

withOther :: a -> QueryGenerator a -> QueryGenerator b Source #

Embed a generator which requires an external parameter.

genIdentifier :: ByteString -> QueryGenerator a Source #

Insert an identifying name. Takes care of proper quotation.

genNestedIdentifier :: ByteString -> ByteString -> QueryGenerator a Source #

Connect two identifiers with a dot. Each identifier is surrounded by quotes if necessary.

genQuote :: ByteString -> QueryGenerator a Source #

Surround with quotes and escape delimiting characters.

joinGens :: ByteString -> [QueryGenerator a] -> QueryGenerator a Source #

Join multiple query generators with a piece of code.

withParamN :: forall n r ts. HasElement n ts r => QueryGenerator r -> Tagged n (QueryGenerator (Tuple ts)) Source #

Redirect the n-th parameter for the given query

withParam0 :: QueryGenerator r -> QueryGenerator (Tuple (r ': ts)) Source #

Redirect the 0th paramter to the given query generator.

withParam1 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (r ': ts))) Source #

Redirect the 1st paramter to the given query generator.

withParam2 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (t1 ': (r ': ts)))) Source #

Redirect the 2nd paramter to the given query generator.

withParam3 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (r ': ts))))) Source #

Redirect the 3rd paramter to the given query generator.

withParam4 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (r ': ts)))))) Source #

Redirect the 4th paramter to the given query generator.

withParam5 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (r ': ts))))))) Source #

Redirect the 5th paramter to the given query generator.

withParam6 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (r ': ts)))))))) Source #

Redirect the 6th paramter to the given query generator.

withParam7 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (r ': ts))))))))) Source #

Redirect the 7th paramter to the given query generator.

withParam8 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (r ': ts)))))))))) Source #

Redirect the 8th paramter to the given query generator.

withParam9 :: QueryGenerator r -> QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (t8 ': (r ': ts))))))))))) Source #

Redirect the 9th paramter to the given query generator.