Add call example of inlineVerifiedQuery.

This commit is contained in:
Kei Hibino 2014-04-22 20:22:29 +09:00
parent bdd11523ec
commit 9ef9f0b65a

View File

@ -1,3 +1,4 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleContexts #-}
import QueryExample
@ -16,8 +17,14 @@ import Database.HDBC.Record.Statement
import Database.HDBC.Record.Query
(runQuery, prepare, fetchUnique, fetchUnique')
import Database.HDBC.Session (withConnectionIO, handleSqlError')
import Database.HDBC.Query.TH (inlineVerifiedQuery)
-- HDBC.PostgreSQL driver doesn't call DB check.
$(inlineVerifiedQuery connect
'userGroup2Fail userGroup2Fail
defaultConfig [] "queryUserGroup2Fail")
runAndPrint :: (Show a, IConnection conn, FromSql SqlValue a, ToSql SqlValue p)
=> conn -> Relation p a -> p -> IO ()
runAndPrint conn rel param = do