{-# LANGUAGE FlexibleContexts #-}
module Database.HDBC.Record.InsertQuery (
PreparedInsertQuery, prepare, prepareInsertQuery, withPrepareInsertQuery,
runPreparedInsertQuery, runInsertQuery
) where
import Database.HDBC (IConnection, SqlValue)
import Database.Relational (InsertQuery)
import Database.Record (ToSql)
import Database.HDBC.Record.Statement
(prepareNoFetch, withPrepareNoFetch, PreparedStatement, executeNoFetch, runNoFetch)
type PreparedInsertQuery p = PreparedStatement p ()
prepare :: IConnection conn
=> conn
-> InsertQuery p
-> IO (PreparedInsertQuery p)
prepare :: forall conn p.
IConnection conn =>
conn -> InsertQuery p -> IO (PreparedInsertQuery p)
prepare = forall (s :: * -> *) conn p.
(UntypeableNoFetch s, IConnection conn) =>
conn -> s p -> IO (PreparedStatement p ())
prepareNoFetch
prepareInsertQuery :: IConnection conn
=> conn
-> InsertQuery p
-> IO (PreparedInsertQuery p)
prepareInsertQuery :: forall conn p.
IConnection conn =>
conn -> InsertQuery p -> IO (PreparedInsertQuery p)
prepareInsertQuery = forall conn p.
IConnection conn =>
conn -> InsertQuery p -> IO (PreparedInsertQuery p)
prepare
withPrepareInsertQuery :: IConnection conn
=> conn
-> InsertQuery p
-> (PreparedInsertQuery p -> IO a)
-> IO a
withPrepareInsertQuery :: forall conn p a.
IConnection conn =>
conn -> InsertQuery p -> (PreparedInsertQuery p -> IO a) -> IO a
withPrepareInsertQuery = forall (s :: * -> *) conn p a.
(UntypeableNoFetch s, IConnection conn) =>
conn -> s p -> (PreparedStatement p () -> IO a) -> IO a
withPrepareNoFetch
runPreparedInsertQuery :: ToSql SqlValue p
=> PreparedInsertQuery p
-> p
-> IO Integer
runPreparedInsertQuery :: forall p.
ToSql SqlValue p =>
PreparedInsertQuery p -> p -> IO Integer
runPreparedInsertQuery = forall p.
ToSql SqlValue p =>
PreparedInsertQuery p -> p -> IO Integer
executeNoFetch
runInsertQuery :: (IConnection conn, ToSql SqlValue p)
=> conn
-> InsertQuery p
-> p
-> IO Integer
runInsertQuery :: forall conn p.
(IConnection conn, ToSql SqlValue p) =>
conn -> InsertQuery p -> p -> IO Integer
runInsertQuery = forall (s :: * -> *) conn a.
(UntypeableNoFetch s, IConnection conn, ToSql SqlValue a) =>
conn -> s a -> a -> IO Integer
runNoFetch