mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2025-01-07 13:46:41 +03:00
Add call example of inlineVerifiedQuery.
This commit is contained in:
parent
bdd11523ec
commit
9ef9f0b65a
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
|
|
||||||
import QueryExample
|
import QueryExample
|
||||||
@ -16,8 +17,14 @@ import Database.HDBC.Record.Statement
|
|||||||
import Database.HDBC.Record.Query
|
import Database.HDBC.Record.Query
|
||||||
(runQuery, prepare, fetchUnique, fetchUnique')
|
(runQuery, prepare, fetchUnique, fetchUnique')
|
||||||
import Database.HDBC.Session (withConnectionIO, handleSqlError')
|
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)
|
runAndPrint :: (Show a, IConnection conn, FromSql SqlValue a, ToSql SqlValue p)
|
||||||
=> conn -> Relation p a -> p -> IO ()
|
=> conn -> Relation p a -> p -> IO ()
|
||||||
runAndPrint conn rel param = do
|
runAndPrint conn rel param = do
|
||||||
|
Loading…
Reference in New Issue
Block a user