Takusen (empty) → 0.7
raw patch · 96 files changed
+50217/−0 lines, 96 filesdep +basedep +mtldep +old-timesetup-changedbinary-added
Dependencies added: base, mtl, old-time, time
Files
- Control/Exception/MonadIO.hs +50/−0
- Database/Enumerator.lhs +1307/−0
- Database/InternalEnumerator.lhs +262/−0
- Database/MSSqlServer/MSSqlFunctions.lhs +93/−0
- Database/MSSqlServer/Test/Enumerator.lhs +32/−0
- Database/MSSqlServer/Test/MSSqlFunctions.lhs +79/−0
- Database/ODBC/Enumerator.lhs +404/−0
- Database/ODBC/OdbcFunctions.hsc +945/−0
- Database/ODBC/Test/Enumerator.lhs +155/−0
- Database/ODBC/Test/OdbcFunctions.lhs +359/−0
- Database/Oracle/Enumerator.lhs +1042/−0
- Database/Oracle/OCIConstants.lhs +178/−0
- Database/Oracle/OCIFunctions.lhs +811/−0
- Database/Oracle/Test/Enumerator.lhs +342/−0
- Database/Oracle/Test/OCIFunctions.lhs +446/−0
- Database/PostgreSQL/Enumerator.lhs +628/−0
- Database/PostgreSQL/PGFunctions.lhs +725/−0
- Database/PostgreSQL/Test/Enumerator.lhs +347/−0
- Database/PostgreSQL/Test/PGFunctions.lhs +385/−0
- Database/PostgreSQL/Test/pgaccess.hs +188/−0
- Database/Sqlite/Enumerator.lhs +462/−0
- Database/Sqlite/SqliteFunctions.lhs +323/−0
- Database/Sqlite/Test/Enumerator.lhs +159/−0
- Database/Sqlite/Test/SqliteFunctions.lhs +293/−0
- Database/Stub/Enumerator.lhs +269/−0
- Database/Stub/Test/Enumerator.lhs +180/−0
- Database/Test/Enumerator.lhs +451/−0
- Database/Test/MultiConnect.lhs +36/−0
- Database/Test/Performance.lhs +100/−0
- Database/Test/Util.lhs +130/−0
- Database/Util.lhs +262/−0
- Foreign/C/Test/UTF8.hs +138/−0
- Foreign/C/UTF8.hs +380/−0
- LICENSE +31/−0
- Main.lhs +70/−0
- README.txt +155/−0
- Setup-114.hs +228/−0
- Setup-1162.hs +270/−0
- Setup.hs +245/−0
- Takusen.cabal +62/−0
- Test/MiniUnit.hs +176/−0
- Test/MiniUnitTest.hs +62/−0
- doc/html/Control-Exception-MonadIO.html +251/−0
- doc/html/Database-Enumerator.html +3664/−0
- doc/html/Database-InternalEnumerator.html +3072/−0
- doc/html/Database-Oracle-Enumerator.html +1070/−0
- doc/html/Database-Oracle-OCIConstants.html +1195/−0
- doc/html/Database-Oracle-OCIFunctions.html +6130/−0
- doc/html/Database-Oracle-Test-Enumerator.html +124/−0
- doc/html/Database-Oracle-Test-OCIFunctions.html +131/−0
- doc/html/Database-PostgreSQL-Enumerator.html +1067/−0
- doc/html/Database-PostgreSQL-PGFunctions.html +3874/−0
- doc/html/Database-PostgreSQL-Test-Enumerator.html +124/−0
- doc/html/Database-PostgreSQL-Test-PGFunctions.html +122/−0
- doc/html/Database-Sqlite-Enumerator.html +518/−0
- doc/html/Database-Sqlite-SqliteFunctions.html +2736/−0
- doc/html/Database-Sqlite-Test-Enumerator.html +124/−0
- doc/html/Database-Sqlite-Test-SqliteFunctions.html +122/−0
- doc/html/Database-Stub-Enumerator.html +493/−0
- doc/html/Database-Stub-Test-Enumerator.html +125/−0
- doc/html/Database-Test-Enumerator.html +1002/−0
- doc/html/Database-Test-MultiConnect.html +127/−0
- doc/html/Database-Test-Performance.html +339/−0
- doc/html/Database-Util.html +796/−0
- doc/html/Main.html +142/−0
- doc/html/Test-MiniUnit.html +601/−0
- doc/html/Test-MiniUnitTest.html +90/−0
- doc/html/doc-index-A.html +178/−0
- doc/html/doc-index-B.html +472/−0
- doc/html/doc-index-C.html +804/−0
- doc/html/doc-index-D.html +408/−0
- doc/html/doc-index-E.html +314/−0
- doc/html/doc-index-F.html +498/−0
- doc/html/doc-index-G.html +254/−0
- doc/html/doc-index-H.html +154/−0
- doc/html/doc-index-I.html +340/−0
- doc/html/doc-index-L.html +194/−0
- doc/html/doc-index-M.html +286/−0
- doc/html/doc-index-N.html +214/−0
- doc/html/doc-index-O.html +746/−0
- doc/html/doc-index-P.html +610/−0
- doc/html/doc-index-Q.html +158/−0
- doc/html/doc-index-R.html +380/−0
- doc/html/doc-index-S.html +952/−0
- doc/html/doc-index-T.html +300/−0
- doc/html/doc-index-U.html +214/−0
- doc/html/doc-index-V.html +146/−0
- doc/html/doc-index-W.html +210/−0
- doc/html/doc-index-Z.html +150/−0
- doc/html/doc-index.html +132/−0
- doc/html/haddock.css +236/−0
- doc/html/haddock.js +15/−0
- doc/html/haskell_icon.gif binary
- doc/html/index.html +553/−0
- doc/html/minus.gif binary
- doc/html/plus.gif binary
+ Control/Exception/MonadIO.hs view
@@ -0,0 +1,50 @@+ +module Control.Exception.MonadIO +( + CaughtMonadIO(..) + , gtry, gtryJust, gbracket, gfinally +) where + +import Control.Monad.Trans +import Control.Exception +import Control.Monad.Reader + +gtry :: (CaughtMonadIO m) => m b -> m (Either Exception b) +gtry a = gcatch (liftM Right a) (return . Left) + +gtryJust :: (CaughtMonadIO m) => + (Exception -> Maybe b) -> m b1 -> m (Either b b1) +gtryJust p a = gcatchJust p (liftM Right a) (return . Left) + +gbracket :: (CaughtMonadIO m) => + m t -> (t -> m a) -> (t -> m b) -> m b +gbracket acq rel act = do + r <- acq + gcatch (do + v <- act r + rel r + return v + ) + (\e -> rel r >> throw e) + +gfinally :: (CaughtMonadIO m) => m t -> m a -> m t +gfinally a f = gbracket (return ()) (const f) (const a) + +class MonadIO m => CaughtMonadIO m where + gcatch :: m a -> (Exception -> m a) -> m a + gcatchJust :: (Exception -> Maybe b) -> m a -> (b -> m a) -> m a + +instance CaughtMonadIO IO where + gcatch = Control.Exception.catch + gcatchJust = catchJust + +instance CaughtMonadIO m => CaughtMonadIO (ReaderT a m) where + gcatch a h = ReaderT $ + \r -> gcatch (runReaderT a r) (\e -> runReaderT (h e) r) + gcatchJust p a h = ReaderT $ + \r -> gcatch (runReaderT a r) (\e -> + case p e of + Nothing -> throw e + Just e' -> runReaderT (h e') r + ) +
+ Database/Enumerator.lhs view
@@ -0,0 +1,1307 @@+ +| +Module : Database.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Abstract database interface, providing a left-fold enumerator +and cursor operations. + +There is a stub: "Database.Stub.Enumerator". +This lets you run the test cases without having a working DBMS installation. +This isn't so valuable now, because it's dead easy to install Sqlite, +but it's still there if you want to try it. + +Additional reading: + + * <http://pobox.com/~oleg/ftp/Haskell/misc.html#fold-stream> + + * <http://pobox.com/~oleg/ftp/papers/LL3-collections-enumerators.txt> + + * <http://www.eros-os.org/pipermail/e-lang/2004-March/009643.html> + +Note that there are a few functions that are exported from each DBMS-specific +implementation which are exposed to the API user, and which are part of +the Takusen API, but are not (necessarily) in this module. +They include: + + * @connect@ (obviously DBMS specific) + + * @prepareQuery, prepareLargeQuery, prepareCommand, sql, sqlbind, prefetch, cmdbind@ + +These functions will typically have the same names and intentions, +but their specific types and usage may differ between DBMS. + + +Had better keep the old style, for older versions of GHC. + +> {-# OPTIONS -cpp #-} +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} +> {-# OPTIONS -fallow-undecidable-instances #-} + +New style extension declarations. + +> {-# LANGUAGE CPP #-} +> {-# LANGUAGE GeneralizedNewtypeDeriving #-} +> {-# LANGUAGE OverlappingInstances #-} +> {-# LANGUAGE UndecidableInstances #-} + + +> module Database.Enumerator +> ( +> -- * Usage +> +> -- $usage_example +> +> -- ** Iteratee Functions +> +> -- $usage_iteratee +> +> -- ** result and result' +> +> -- $usage_result +> +> -- ** Rank-2 types, ($), and the monomorphism restriction +> +> -- $usage_rank2_types +> +> -- ** Bind Parameters +> +> -- $usage_bindparms +> +> -- ** Multiple (and nested) Result Sets +> +> -- $usage_multiresultset +> +> -- * Sessions and Transactions +> DBM -- The data constructor is not exported +> , withSession, withContinuedSession +> , commit, rollback, beginTransaction +> , withTransaction +> , IE.IsolationLevel(..) +> , execDDL, execDML, inquire +> +> -- * Exceptions and handlers +> , DBException(..) +> , formatDBException, basicDBExceptionReporter +> , reportRethrow, reportRethrowMsg +> , catchDB, catchDBError, ignoreDBError, IE.throwDB +> +> -- * Preparing and Binding +> , PreparedStmt(..) -- data constructor not exported +> , withPreparedStatement +> , withBoundStatement, IE.bindP +> +> -- * Iteratees and Cursors +> , doQuery +> , IterResult, IterAct +> , IE.currentRowNum, NextResultSet(..), RefCursor(..) +> , cursorIsEOF, cursorCurrent, cursorNext +> , withCursor +> +> -- * Utilities +> , ifNull, result, result' +> ) where + +> import Prelude hiding (catch) +> import Data.Dynamic +> import Data.IORef +> import Data.Time +> import Control.Monad.Trans (liftIO) +> import Control.Exception (throw, +> dynExceptions, throwDyn, bracket, Exception, finally) +> import qualified Control.Exception (catch) +> import Control.Monad.Fix +> import Control.Monad.Reader +> import Control.Exception.MonadIO +> import qualified Database.InternalEnumerator as IE +> import Database.InternalEnumerator (DBException(..)) + + +----------------------------------------------------------- + + +----------------------------------------------------------- + + +| 'IterResult' and 'IterAct' give us some type sugar. +Without them, the types of iteratee functions become +quite unwieldy. + +> type IterResult seedType = Either seedType seedType +> type IterAct m seedType = seedType -> m (IterResult seedType) + +| Catch 'Database.InteralEnumerator.DBException's thrown in the 'DBM' +monad. + +> catchDB :: CaughtMonadIO m => m a -> (DBException -> m a) -> m a +> catchDB action handler = gcatch action $ \e -> +> maybe (throw e) handler (dynExceptions e >>= fromDynamic) + + +|This simple handler reports the error to @stdout@ and swallows it +i.e. it doesn't propagate. + +> basicDBExceptionReporter :: CaughtMonadIO m => DBException -> m () +> basicDBExceptionReporter e = liftIO (putStrLn (formatDBException e)) + +| This handler reports the error and propagates it +(usually to force the program to halt). + +> reportRethrow :: CaughtMonadIO m => DBException -> m a +> --reportRethrow e = basicDBExceptionReporter e >> IE.throwDB e +> reportRethrow e = reportRethrowMsg "" e + +| Same as reportRethrow, but you can prefix some text to the error +(perhaps to indicate which part of your program raised it). + +> reportRethrowMsg :: CaughtMonadIO m => String -> DBException -> m a +> reportRethrowMsg m e = liftIO (putStr m) >> basicDBExceptionReporter e >> IE.throwDB e + +| A show for 'Database.InteralEnumerator.DBException's. + +> formatDBException :: DBException -> String +> formatDBException (DBError (ssc, sssc) e m) = +> ssc ++ sssc ++ " " ++ (show e) ++ ": " ++ m +> formatDBException (DBFatal (ssc, sssc) e m) = +> ssc ++ sssc ++ " " ++ (show e) ++ ": " ++ m +> formatDBException (DBUnexpectedNull r c) = +> "Unexpected null in row " ++ (show r) ++ ", column " ++ (show c) ++ "." +> formatDBException (DBNoData) = "Fetch: no more data." + + +|If you want to trap a specific error number, use this. +It passes anything else up. + +> catchDBError :: (CaughtMonadIO m) => +> Int -> m a -> (DBException -> m a) -> m a +> catchDBError n action handler = catchDB action +> (\dberror -> +> case dberror of +> DBError ss e m | e == n -> handler dberror +> _ | otherwise -> IE.throwDB dberror +> ) + +| Analogous to 'catchDBError', but ignores specific errors instead +(propagates anything else). + +> ignoreDBError :: (CaughtMonadIO m) => Int -> m a -> m a +> ignoreDBError n action = catchDBError n action (\e -> return undefined) + +-------------------------------------------------------------------- +-- ** Session monad +-------------------------------------------------------------------- + +The DBM data constructor is NOT exported. + +One may think to quantify over sess in |withSession|. We won't need +any mark then, I gather. +The quantification over Session is quite bothersome: need to enumerate +all class constraints for the Session (like IQuery, DBType, etc). + +> newtype IE.ISession sess => DBM mark sess a = DBM (ReaderT sess IO a) +#ifndef __HADDOCK__ +> deriving (Functor, Monad, MonadIO, MonadFix, MonadReader sess) +#else +> -- Haddock can't cope with the "MonadReader sess" instance +> deriving (Functor, Monad, MonadIO, MonadFix) +#endif +> unDBM (DBM x) = x + + +> instance IE.ISession si => CaughtMonadIO (DBM mark si) where +> gcatch a h = DBM ( gcatch (unDBM a) (unDBM . h) ) +> gcatchJust p a h = DBM ( gcatchJust p (unDBM a) (unDBM . h) ) + +| Typeable constraint is to prevent the leakage of Session and other +marked objects. + +> withSession :: (Typeable a, IE.ISession sess) => +> IE.ConnectA sess -> (forall mark. DBM mark sess a) -> IO a +> withSession (IE.ConnectA connecta) m = +> bracket (connecta) (IE.disconnect) (runReaderT (unDBM m)) + + +| Persistent database connections. +This issue has been brought up by Shanky Surana. The following design +is inspired by that exchange. + +On one hand, implementing persistent connections is easy. One may say we should +have added them long time ago, to match HSQL, HDBC, and similar +database interfaces. Alas, implementing persistent connection +safely is another matter. The simplest design is like the following + + > withContinuedSession :: (Typeable a, IE.ISession sess) => + > IE.ConnectA sess -> (forall mark. DBM mark sess a) -> + > IO (a, IE.ConnectA sess) + > withContinuedSession (IE.ConnectA connecta) m = do + > conn <- connecta + > r <- runReaderT (unDBM m) conn + > return (r,(return conn)) + +so that the connection object is returned as the result and can be +used again with withContinuedSession or withSession. The problem is +that nothing prevents us from writing: + + > (r1,conn) <- withContinuedSession (connect "...") query1 + > r2 <- withSession conn query2 + > r3 <- withSession conn query3 + +That is, we store the suspended connection and then use it twice. +But the first withSession closes the connection. So, the second +withSession gets an invalid session object. Invalid in a sense that +even memory may be deallocated, so there is no telling what happens +next. Also, as we can see, it is difficult to handle errors and +automatically dispose of the connections if the fatal error is +encountered. + +All these problems are present in other interfaces... In the +case of a suspended connection, the problem is how to enforce the +/linear/ access to a variable. It can be enforced, via a +state-changing monad. The implementation below makes +the non-linear use of a suspended connection a run-time checkable +condition. It will be generic and safe - fatal errors close the +connection, an attempt to use a closed connection raises an error, and +we cannot reuse a connection. We have to write: + + > (r1, conn1) <- withContinuedSession conn ... + > (r2, conn2) <- withContinuedSession conn1 ... + > (r3, conn3) <- withContinuedSession conn2 ... + +etc. If we reuse a suspended connection or use a closed connection, +we get a run-time (exception). That is of course not very +satisfactory - and yet better than a segmentation fault. + +> withContinuedSession :: (Typeable a, IE.ISession sess) => +> IE.ConnectA sess -> (forall mark. DBM mark sess a) +> -> IO (a, IE.ConnectA sess) +> withContinuedSession (IE.ConnectA connecta) m = +> do conn <- connecta -- this invalidates connecta +> r <- runReaderT (unDBM m) conn +> `Control.Exception.catch` (\e -> IE.disconnect conn >> throw e) +> -- make a new, one-shot connecta +> hasbeenused <- newIORef False +> let connecta = do +> fl <- readIORef hasbeenused +> when fl $ error "connecta has been re-used" +> writeIORef hasbeenused True +> return conn +> return (r,IE.ConnectA connecta) + + + +> beginTransaction :: +> (MonadReader s (ReaderT s IO), IE.ISession s) => +> IE.IsolationLevel -> DBM mark s () +> beginTransaction il = DBM (ask >>= \s -> lift $ IE.beginTransaction s il) +> commit :: IE.ISession s => DBM mark s () +> commit = DBM( ask >>= lift . IE.commit ) +> rollback :: IE.ISession s => DBM mark s () +> rollback = DBM( ask >>= lift . IE.rollback ) + + +> executeCommand :: IE.Command stmt s => stmt -> DBM mark s Int +> executeCommand stmt = DBM( ask >>= \s -> lift $ IE.executeCommand s stmt ) + +| DDL operations don't manipulate data, so we return no information. +If there is a problem, an exception will be raised. + +> execDDL :: IE.Command stmt s => stmt -> DBM mark s () +> execDDL stmt = executeCommand stmt >> return () + +| Returns the number of rows affected. + +> execDML :: IE.Command stmt s => stmt -> DBM mark s Int +> execDML = executeCommand + +| Allows arbitrary actions to be run the DBM monad. +the back-end developer must supply instances of EnvInquiry, +which is hidden away in "Database.InternalEnumerator". +An example of this is 'Database.Sqlite.Enumerator.LastInsertRowid'. + +> inquire :: IE.EnvInquiry key s result => key -> DBM mark s result +> inquire key = DBM( ask >>= \s -> lift $ IE.inquire key s ) + +-------------------------------------------------------------------- +-- ** Statements; Prepared statements +-------------------------------------------------------------------- + +> newtype PreparedStmt mark stmt = PreparedStmt stmt + +> executePreparation :: IE.IPrepared stmt sess bstmt bo => +> IE.PreparationA sess stmt -> DBM mark sess (PreparedStmt mark stmt) +> executePreparation (IE.PreparationA action) = +> DBM( ask >>= \sess -> lift $ action sess >>= return . PreparedStmt) + +> data NextResultSet mark stmt = NextResultSet (PreparedStmt mark stmt) +> data RefCursor a = RefCursor a + + +The exception handling in withPreparedStatement looks awkward, +but there's a good reason... + +Suppose there's some sort of error when we call destroyStmt. +The exception handler also must call destroyStmt (because the exception +might have also come from the invocation of action), but calling destroyStmt +might also raise a new exception (for example, a different error is raised +if you re-try a failed CLOSE-cursor, because the transaction is aborted). +So we wrap this call with a catch, and ensure that the original exception +is preserved and re-raised. + +| Prepare a statement and run a DBM action over it. +This gives us the ability to re-use a statement, +for example by passing different bind values for each execution. + +The Typeable constraint is to prevent the leakage of marked things. +The type of bound statements should not be exported (and should not be +in Typeable) so the bound statement can't leak either. + +> withPreparedStatement :: +> (Typeable a, IE.IPrepared stmt sess bstmt bo) +> => IE.PreparationA sess stmt +> -- ^ preparation action to create prepared statement; +> -- this action is usually created by @prepareQuery\/Command@ +> -> (PreparedStmt mark stmt -> DBM mark sess a) +> -- ^ DBM action that takes a prepared statement +> -> DBM mark sess a +> withPreparedStatement pa action = do +> ps <- executePreparation pa +> gcatch ( do +> v <- action ps +> destroyStmt ps +> return v +> ) (\e -> gcatch (destroyStmt ps >> throw e) (\_ -> throw e)) + + +Not exported. + +> destroyStmt :: (IE.ISession sess, IE.IPrepared stmt sess bstmt bo) +> => PreparedStmt mark stmt -> DBM mark sess () +> destroyStmt (PreparedStmt stmt) = DBM( ask >>= \s -> lift $ IE.destroyStmt s stmt ) + + + +| Applies a prepared statement to bind variables to get a bound statement, +which is passed to the provided action. +Note that by the time it is passed to the action, the query or command +has usually been executed. +A bound statement would normally be an instance of +'Database.InternalEnumerator.Statement', so it can be passed to +'Database.Enumerator.doQuery' +in order to process the result-set, and also an instance of +'Database.InternalEnumerator.Command', so that we can write +re-usable DML statements (inserts, updates, deletes). + +The Typeable constraint is to prevent the leakage of marked things. +The type of bound statements should not be exported (and should not be +in Typeable) so the bound statement can't leak either. + +> withBoundStatement :: +> (Typeable a, IE.IPrepared stmt s bstmt bo) +> => PreparedStmt mark stmt +> -- ^ prepared statement created by withPreparedStatement +> -> [IE.BindA s stmt bo] +> -- ^ bind values +> -> (bstmt -> DBM mark s a) +> -- ^ action to run over bound statement +> -> DBM mark s a +> withBoundStatement (PreparedStmt stmt) ba f = +> DBM ( ask >>= \s -> +> lift $ IE.bindRun s stmt ba (\b -> runReaderT (unDBM (f b)) s)) + + +-------------------------------------------------------------------- +-- ** Buffers and QueryIteratee +-------------------------------------------------------------------- + + +|The class QueryIteratee is not for the end user. It provides the +interface between the low- and the middle-layers of Takusen. The +middle-layer - enumerator - is database-independent then. + +> class MonadIO m => QueryIteratee m q i seed b | +> i -> m, i -> seed, q -> b where +> iterApply :: q -> [b] -> seed -> i -> m (IterResult seed) +> allocBuffers :: q -> i -> IE.Position -> m [b] + +|This instance of the class is the terminating case +i.e. where the iteratee function has one argument left. +The argument is applied, and the result returned. + +> instance (IE.DBType a q b, MonadIO m) => +> QueryIteratee m q (a -> seed -> m (IterResult seed)) seed b where +> iterApply q [buf] seed fn = do +> v <- liftIO $ IE.fetchCol q buf +> fn v seed +> allocBuffers q _ n = liftIO $ +> sequence [IE.allocBufferFor (undefined::a) q n] + + +|This instance of the class implements the starting and continuation cases. + +> instance (QueryIteratee m q i' seed b, IE.DBType a q b) +> => QueryIteratee m q (a -> i') seed b where +> iterApply q (buffer:moreBuffers) seed fn = do +> v <- liftIO $ IE.fetchCol q buffer +> iterApply q moreBuffers seed (fn v) +> allocBuffers q fn n = do +> buffer <- liftIO $ IE.allocBufferFor (undefined::a) q n +> moreBuffers <- allocBuffers q (undefined::i') (n+1) +> return (buffer:moreBuffers) + + + +-------------------------------------------------------------------- +-- ** A Query monad and cursors +-------------------------------------------------------------------- + + +> type CollEnumerator i m s = i -> s -> m s +> type Self i m s = i -> s -> m s +> type CFoldLeft i m s = Self i m s -> CollEnumerator i m s + +|A DBCursor is an IORef-mutable-pair @(a, Maybe f)@, where @a@ is the result-set so far, +and @f@ is an IO action that fetches and returns the next row (when applied to True), +or closes the cursor (when applied to False). +If @Maybe@ f is @Nothing@, then the result-set has been exhausted +(or the iteratee function terminated early), +and the cursor has already been closed. + +> newtype DBCursor mark ms a = +> DBCursor (IORef (a, Maybe (Bool-> ms (DBCursor mark ms a)))) + + +| The left-fold interface. + +> doQuery :: (IE.Statement stmt sess q, +> QueryIteratee (DBM mark sess) q i seed b, +> IE.IQuery q sess b) => +> stmt -- ^ query +> -> i -- ^ iteratee function +> -> seed -- ^ seed value +> -> DBM mark sess seed +> doQuery stmt iteratee seed = do +> (lFoldLeft, finalizer) <- doQueryMaker stmt iteratee +> gcatch (fix lFoldLeft iteratee seed) +> (\e -> do +> finalizer +> liftIO (throw e) +> ) + + +An auxiliary function, not seen by the user. + +> doQueryMaker stmt iteratee = do +> sess <- ask +> query <- liftIO $ IE.makeQuery sess stmt +> buffers <- allocBuffers query iteratee 1 +> let +> finaliser = +> liftIO (mapM_ (IE.freeBuffer query) buffers) +> >> liftIO (IE.destroyQuery query) +> hFoldLeft self iteratee initialSeed = do +> let +> handle seed True = iterApply query buffers seed iteratee +> >>= handleIter +> handle seed False = (finaliser) >> return seed +> handleIter (Right seed) = self iteratee seed +> handleIter (Left seed) = (finaliser) >> return seed +> liftIO (IE.fetchOneRow query) >>= handle initialSeed +> return (hFoldLeft, finaliser) + + +Another auxiliary function, also not seen by the user. + +> openCursor stmt iteratee seed = do +> ref <- liftIO (newIORef (seed,Nothing)) +> (lFoldLeft, finalizer) <- doQueryMaker stmt iteratee +> let update v = liftIO $ modifyIORef ref (\ (_, f) -> (v, f)) +> let +> close finalseed = do +> liftIO$ modifyIORef ref (\_ -> (finalseed, Nothing)) +> finalizer +> return (DBCursor ref) +> let +> k' fni seed' = +> let +> k fni' seed'' = do +> let k'' flag = if flag then k' fni' seed'' else close seed'' +> liftIO$ modifyIORef ref (\_->(seed'', Just k'')) +> return seed'' +> in do +> liftIO$ modifyIORef ref (\_ -> (seed', Nothing)) +> do {lFoldLeft k fni seed' >>= update} +> return $ DBCursor ref +> k' iteratee seed + + + +|cursorIsEOF's return value tells you if there are any more rows or not. +If you call 'cursorNext' when there are no more rows, +a 'DBNoData' exception is thrown. +Cursors are automatically closed and freed when: + + * the iteratee returns @Left a@ + + * the query result-set is exhausted. + +To make life easier, we've created a 'withCursor' function, +which will clean up if an error (exception) occurs, +or the code exits early. +You can nest them to get interleaving, if you desire: + + > withCursor query1 iter1 [] $ \c1 -> do + > withCursor query2 iter2 [] $ \c2 -> do + > r1 <- cursorCurrent c1 + > r2 <- cursorCurrent c2 + > ... + > return something + + +Note that the type of the functions below is set up so to perpetuate +the mark. + +> cursorIsEOF :: DBCursor mark (DBM mark s) a -> DBM mark s Bool +> cursorIsEOF (DBCursor ref) = do +> (_, maybeF) <- liftIO $ readIORef ref +> return $ maybe True (const False) maybeF + +|Returns the results fetched so far, processed by iteratee function. + +> cursorCurrent :: DBCursor mark (DBM mark s) a -> DBM mark s a +> cursorCurrent (DBCursor ref) = do +> (v, _) <- liftIO $ readIORef ref +> return v + +|Advance the cursor. Returns the cursor. The return value is usually ignored. + +> cursorNext :: DBCursor mark (DBM mark s) a +> -> DBM mark s (DBCursor mark (DBM mark s) a) +> cursorNext (DBCursor ref) = do +> (_, maybeF) <- liftIO $ readIORef ref +> maybe (IE.throwDB DBNoData) ($ True) maybeF + + +Returns the cursor. The return value is usually ignored. +This function is not available to the end user (i.e. not exported). +The cursor is closed automatically when its region exits. + +> cursorClose c@(DBCursor ref) = do +> (_, maybeF) <- liftIO $ readIORef ref +> maybe (return c) ($ False) maybeF + + +|Ensures cursor resource is properly tidied up in exceptional cases. +Propagates exceptions after closing cursor. +The Typeable constraint is to prevent cursors and other marked values +(like cursor computations) from escaping. + +> withCursor :: +> ( Typeable a, IE.Statement stmt sess q +> , QueryIteratee (DBM mark sess) q i seed b +> , IE.IQuery q sess b +> ) => +> stmt -- ^ query +> -> i -- ^ iteratee function +> -> seed -- ^ seed value +> -> (DBCursor mark (DBM mark sess) seed -> DBM mark sess a) -- ^ action taking cursor parameter +> -> DBM mark sess a +> withCursor stmt iteratee seed action = +> gbracket (openCursor stmt iteratee seed) cursorClose action + + +Although withTransaction has the same structure as a bracket, +we can't use bracket because the resource-release action +(commit or rollback) differs between the success and failure cases. + +|Perform an action as a transaction: commit afterwards, +unless there was an exception, in which case rollback. + +> withTransaction :: (IE.ISession s) => +> IE.IsolationLevel -> DBM mark s a -> DBM mark s a +> +> withTransaction isolation action = do +> beginTransaction isolation +> gcatch ( do +> v <- action +> commit +> return v +> ) (\e -> rollback >> throw e ) + + +-------------------------------------------------------------------- +-- ** Misc. +-------------------------------------------------------------------- + + +|Useful utility function, for SQL weenies. + +> ifNull :: Maybe a -- ^ nullable value +> -> a -- ^ value to substitute if first parameter is null i.e. 'Data.Maybe.Nothing' +> -> a +> ifNull value subst = maybe subst id value + + + +| Another useful utility function. +Use this to return a value from an iteratee function (the one passed to +'Database.Enumerator.doQuery'). +Note that you should probably nearly always use the strict version. + +> result :: (Monad m) => IterAct m a +> result x = return (Right x) + + +|A strict version. This is recommended unless you have a specific need for laziness, +as the lazy version will gobble stack and heap. +If you have a large result-set (in the order of 10-100K rows or more), +it is likely to exhaust the standard 1M GHC stack. +Whether or not 'result' eats memory depends on what @x@ does: +if it's a delayed computation then it almost certainly will. +This includes consing elements onto a list, +and arithmetic operations (counting, summing, etc). + +> result' :: (Monad m) => IterAct m a +> result' x = return (Right $! x) + + +That's the code... now for the documentation. + + +==================================================================== +== Usage notes +==================================================================== + + +$usage_example + +Let's look at some example code: + + > -- sample code, doesn't necessarily compile + > module MyDbExample is + > + > import Database.Oracle.Enumerator + > import Database.Enumerator + > ... + > + > query1Iteratee :: (Monad m) => Int -> String -> Double -> IterAct m [(Int, String, Double)] + > query1Iteratee a b c accum = result' ((a, b, c):accum) + > + > -- non-query actions. + > otherActions session = do + > execDDL (sql "create table blah") + > execDML (sql "insert into blah ...") + > commit + > -- Use withTransaction to delimit a transaction. + > -- It will commit at the end, or rollback if an error occurs. + > withTransaction Serialisable ( do + > execDML (sql "update blah ...") + > execDML (sql "insert into blah ...") + > ) + > + > main :: IO () + > main = do + > withSession (connect "user" "password" "server") ( do + > -- simple query, returning reversed list of rows. + > r <- doQuery (sql "select a, b, c from x") query1Iteratee [] + > liftIO $ putStrLn $ show r + > otherActions session + > ) + + Notes: + + * connection is made by 'Database.Enumerator.withSession', + which also disconnects when done i.e. 'Database.Enumerator.withSession' + delimits the connection. + You must pass it a connection action, which is back-end specific, + and created by calling the 'Database.Sqlite.Enumerator.connect' + function from the relevant back-end. + + * inside the session, the usual transaction delimiter commands are usable + e.g. 'Database.Enumerator.beginTransaction' 'Database.InternalEnumerator.IsolationLevel', + 'Database.Enumerator.commit', 'Database.Enumerator.rollback', and + 'Database.Enumerator.withTransaction'. + We also provide 'Database.Enumerator.execDML' and 'Database.Enumerator.execDDL'. + + * non-DML and -DDL commands - i.e. queries - are processed by + 'Database.Enumerator.doQuery' (this is the API for our left-fold). + See more explanation and examples below in /Iteratee Functions/ and + /Bind Parameters/ sections. + +The first argument to 'Database.Enumerator.doQuery' must be an instance of +'Database.InternalEnumerator.Statement'. +Each back-end will provide a useful set of @Statement@ instances +and associated constructor functions for them. +For example, currently all back-ends have: + + * for basic, all-text statements (no bind variables, default row-caching) + which can be used as queries or commands: + + > sql "select ..." + + * for a select with bind variables: + + > sqlbind "select ..." [bindP ..., bindP ...] + + * for a select with bind variables and row caching: + + > prefetch 100 "select ..." [bindP ..., bindP ...] + + * for a DML command with bind variables: + + > cmdbind "insert into ..." [bindP ..., bindP ...] + + * for a reusable prepared statement: we have to first create the + prepared statement, and then bind in a separate step. + This separation lets us re-use prepared statements: + + > let stmt = prepareQuery (sql "select ...") + > withPreparedStatement stmt $ \pstmt -> + > withBoundStatement pstmt [bindP ..., bindP ...] $ \bstmt -> do + > result <- doQuery bstmt iter seed + > ... + +The PostgreSQL backend additionally requires that when preparing statements, +you (1) give a name to the prepared statement, +and (2) specify types for the bind parameters. +The list of bind-types is created by applying the +'Database.PostgrSQL.Enumerator.bindType' function +to dummy values of the appropriate types. e.g. + + > let stmt = prepareQuery "stmtname" (sql "select ...") [bindType "", bindType (0::Int)] + > withPreparedStatement stmt $ \pstmt -> ... + +A longer explanation of prepared statements and +bind variables is in the Bind Parameters section below. + + +$usage_iteratee + +'Database.Enumerator.doQuery' takes an iteratee function, of n arguments. +Argument n is the accumulator (or seed). +For each row that is returned by the query, +the iteratee function is called with the data from that row in +arguments 1 to n-1, and the current accumulated value in the argument n. + +The iteratee function returns the next value of the accumulator, +wrapped in an 'Data.Either.Either'. +If the 'Data.Either.Either' value is @Left@, then the query will terminate, +returning the wrapped accumulator\/seed value. +If the value is @Right@, then the query will continue, with the next row +begin fed to the iteratee function, along with the new accumulator\/seed value. + +In the example above, @query1Iteratee@ simply conses the new row (as a tuple) +to the front of the accumulator. +The initial seed passed to 'Database.Enumerator.doQuery' was an empty list. +Consing the rows to the front of the list results in a list +with the rows in reverse order. + +The types of values that can be used as arguments to the iteratee function +are back-end specific; they must be instances of the class +'Database.InternalEnumerator.DBType'. +Most backends directly support the usual lowest-common-denominator set +supported by most DBMS's: 'Data.Int.Int', 'Data.Char.String', +'Prelude.Double', 'Data.Time.UTCTime'. +('Data.Int.Int64' is often, but not always, supported.) + +By directly support we mean there is type-specific marshalling code +implemented. +Indirect support for 'Text.Read.Read'- and 'Text.Show.Show'-able types +is supported by marshalling to and from 'Data.Char.String's. +This is done automatically by the back-end; +there is no need for user-code to perform the marshalling, +as long as instances of 'Text.Read.Read' and 'Text.Show.Show' are defined. + +The iteratee function operates in the 'DBM' monad, +so if you want to do IO in it you must use 'Control.Monad.Trans.liftIO' +(e.g. @liftIO $ putStrLn \"boo\"@ ) to lift the IO action into 'DBM'. + +The iteratee function is not restricted to just constructing lists. +For example, a simple counter function would ignore its arguments, +and the accumulator would simply be the count e.g. + + > counterIteratee :: (Monad m) => Int -> IterAct m Int + > counterIteratee _ i = result' $ (1 + i) + +The iteratee function that you pass to 'Database.Enumerator.doQuery' +needs type information, +at least for the arguments if not the return type (which is typically +determined by the type of the seed). +The type synonyms 'IterAct' and 'IterResult' give some convenience +in writing type signatures for iteratee functions: + + > type IterResult seedType = Either seedType seedType + > type IterAct m seedType = seedType -> m (IterResult seedType) + +Without them, the type for @counterIteratee@ would be: + + > counterIteratee :: (Monad m) => Int -> Int -> m (Either Int Int) + +which doesn't seem so onerous, but for more elaborate seed types +(think large tuples) it certainly helps e.g. + + > iter :: Monad m => + > String -> Double -> CalendarTime -> [(String, Double, CalendarTime)] + > -> m (Either [(String, Double, CalendarTime)] [(String, Double, CalendarTime)] ) + +reduces to (by using 'IterAct' and 'IterResult'): + + > iter :: Monad m => + > String -> Double -> CalendarTime -> IterAct m [(String, Double, CalendarTime)] + + + +$usage_result + +The 'result' (lazy) and @result\'@ (strict) functions are another convenient shorthand +for returning values from iteratee functions. The return type from an iteratee is actually +@Either seed seed@, where you return @Right@ if you want processing to continue, +or @Left@ if you want processing to stop before the result-set is exhausted. +The common case is: + + > query1Iteratee a b c accum = return (Right ((a, b, c):accum)) + +which we can write as + + > query1Iteratee a b c accum = result $ (a, b, c):accum) + +We have lazy and strict versions of @result@. The strict version is almost certainly +the one you want to use. If you come across a case where the lazy function is useful, +please tell us about it. The lazy function tends to exhaust the stack for large result-sets, +whereas the strict function does not. +This is due to the accumulation of a large number of unevaluated thunks, +and will happen even for simple arithmetic operations such as counting or summing. + +If you use the lazy function and you have stack\/memory problems, do some profiling. +With GHC: + + * ensure the iteratee has its own cost-centre (make it a top-level function) + + * compile with @-prof -auto-all@ + + * run with @+RTS -p -hr -RTS@ + + * run @hp2ps@ over the resulting @.hp@ file to get a @.ps@ document, and take a look at it. + Retainer sets are listed on the RHS, and are prefixed with numbers e.g. (13)CAF, (2)SYSTEM. + At the bottom of the @.prof@ file you'll find the full descriptions of the retainer sets. + Match the number in parentheses on the @.ps@ graph with a SET in the @.prof@ file; + the one at the top of the @.ps@ graph is the one using the most memory. + +You'll probably find that the lazy iteratee is consuming all of the stack with lazy thunks, +which is why we recommend the strict function. + + + +$usage_rank2_types + +In some examples we use the application operator ($) instead of parentheses +(some might argue that this is a sign of developer laziness). +At first glance, ($) and conventional function application via juxtaposition +seem to be interchangeable e.g. + + > liftIO (putStrLn (show x)) + + looks equivalent to + + > liftIO $ putStrLn $ show x + +But they're not, because Haskell's type system gives us a nice compromise. + +In a Hindley-Milner type system (like ML) there is no difference between +($) and function application, because polymorphic functions are not +first-class and cannot be passed to other functions. +At the other end of the scale, ($) and function application in System F +are equivalent, because polymorphic functions can be passed to other +functions. However, type inference in System F is undecidable. + +Haskell hits the sweet spot: maintaining full inference, +and permitting rank-2 polymorphism, in exchange for very few +type annotations. Only functions that take polymorphic functions (and +thus are higher-rank) need type signatures. Rank-2 types can't be +inferred. The function ($) is a regular, rank-1 function, and so +it can't take polymorphic functions as arguments and return +polymorphic functions. + +Here's an example where ($) fails: +we supply a simple test program in the README file. +If you change the @withSession@ line to use ($), like so +(and remove the matching end-parenthese): + + > withSession (connect "sqlite_db") $ do + +then you get the error: + + > Main.hs:7:38: + > Couldn't match expected type `forall mark. DBM mark Session a' + > against inferred type `a1 b' + > In the second argument of `($)', namely + > ... + +Another way of rewriting it is like this, where we separate the +'Database.Enumerator.DBM' action into another function: + + > {-# OPTIONS -fglasgow-exts #-} + > module Main where + > import Database.Sqlite.Enumerator + > import Control.Monad.Trans (liftIO) + > main = flip catchDB reportRethrow $ + > withSession (connect "sqlite_db") hello + > + > hello = withTransaction RepeatableRead $ do + > let iter (s::String) (_::String) = result s + > result <- doQuery (sql "select 'Hello world.'") iter "" + > liftIO (putStrLn result) + +which gives this error: + + > Main.hs:9:2: + > Inferred type is less polymorphic than expected + > Quantified type variable `mark' is mentioned in the environment: + > hello :: DBM mark Session () (bound at Main.hs:15:0) + > ... + +This is just the monomorphism restriction in action. +Sans a type signature, the function `hello' is monomorphised +(that is, `mark' is replaced with (), per GHC rules). +This is easily fixed by adding this type declaration: + + > hello :: DBM mark Session () + + + + +$usage_bindparms + +Support for bind variables varies between DBMS's. + +We call 'Database.Enumerator.withPreparedStatement' function to prepare +the statement, and then call 'Database.Enumerator.withBoundStatement' +to provide the bind values and execute the query. +The value returned by 'Database.Enumerator.withBoundStatement' +is an instance of the 'Database.InternalEnumerator.Statement' class, +so it can be passed to 'Database.Enumerator.doQuery' for result-set processing. + +When we call 'Database.Enumerator.withPreparedStatement', we must pass +it a \"preparation action\", which is simply an action that returns +the prepared query. The function to create this action varies between backends, +and by convention is called 'Database.PostgreSQL.Enumerator.prepareQuery'. +For DML statements, you must use 'Database.PostgreSQL.Enumerator.prepareCommand', +as the library needs to do something different depending on whether or not the +statement returns a result-set. + +For queries with large result-sets, we provide +'Database.PostgreSQL.Enumerator.prepareLargeQuery', +which takes an extra parameter: the number of rows to prefetch +in a network call to the server. +This aids performance in two ways: +1. you can limit the number of rows that come back to the +client, in order to use less memory, and +2. the client library will cache rows, so that a network call to +the server is not required for every row processed. + +With PostgreSQL, we must specify the types of the bind parameters +when the query is prepared, so the 'Database.PostgreSQL.Enumerator.prepareQuery' +function takes a list of 'Database.PostgreSQL.Enumerator.bindType' values. +Also, PostgreSQL requires that prepared statements are named, +although you can use \"\" as the name. + +With Sqlite and Oracle, we simply pass the query text to +'Database.PostgreSQL.Sqlite.prepareQuery', +so things are slightly simpler for these backends. + +Perhaps an example will explain it better: + + > postgresBindExample = do + > let + > query = sql "select blah from blahblah where id = ? and code = ?" + > iter :: (Monad m) => String -> IterAct m [String] + > iter s acc = result $ s:acc + > bindVals = [bindP (12345::Int), bindP "CODE123"] + > bindTypes = [bindType (0::Int), bindType ""] + > withPreparedStatement (prepareQuery "stmt1" query bindTypes) $ \pstmt -> do + > withBoundStatement pstmt bindVals $ \bstmt -> do + > actual <- doQuery bstmt iter [] + > liftIO (print actual) + +Note that we pass @bstmt@ to 'Database.Enumerator.doQuery'; +this is the bound statement object created by +'Database.Enumerator.withBoundStatement'. + +The Oracle\/Sqlite example code is almost the same, except for the +call to 'Database.Sqlite.Enumerator.prepareQuery': + + > sqliteBindExample = do + > let + > query = sql "select blah from blahblah where id = ? and code = ?" + > iter :: (Monad m) => String -> IterAct m [String] + > iter s acc = result $ s:acc + > bindVals = [bindP (12345::Int), bindP "CODE123"] + > withPreparedStatement (prepareQuery query) $ \pstmt -> do + > withBoundStatement pstmt bindVals $ \bstmt -> do + > actual <- doQuery bstmt iter [] + > liftIO (print actual) + +It can be a bit tedious to always use the @withPreparedStatement+withBoundStatement@ +combination, so for the case where you don't plan to re-use the query, +we support a short-cut for bundling the query text and parameters. +The next example is valid for PostgreSQL, Sqlite, and Oracle +(the Sqlite implementation provides a dummy 'Database.Sqlite.Enumerator.prefetch' +function to ensure we have a consistent API). +Sqlite has no facility for prefetching - it's an embedded database, so no +network round-trip - so the Sqlite implementation ignores the prefetch count: + + > bindShortcutExample = do + > let + > iter :: (Monad m) => String -> IterAct m [String] + > iter s acc = result $ s:acc + > bindVals = [bindP (12345::Int), bindP "CODE123"] + > query = prefetch 1000 "select blah from blahblah where id = ? and code = ?" bindVals + > actual <- doQuery query iter [] + > liftIO (print actual) + +A caveat of using prefetch with PostgreSQL is that you must be inside a transaction. +This is because the PostgreSQL implementation uses a cursor and \"FETCH FORWARD\" +to implement fetching a block of rows in a single network call, +and PostgreSQL requires that cursors are only used inside transactions. +It can be as simple as wrapping calls to 'Database.Enumerator.doQuery' by +'Database.Enumerator.withTransaction', +or you may prefer to delimit your transactions elsewhere (the API supports +'Database.InternalEnumerator.beginTransaction' and +'Database.InternalEnumerator.commit', if you prefer to use them): + + > withTransaction RepeatableRead $ do + > actual <- doQuery query iter [] + > liftIO (print actual) + +You may have noticed that for 'Data.Int.Int' and 'Prelude.Double' literal +bind values, we have to tell the compiler the type of the literal. +I assume this is due to interaction (which I don't fully understand and therefore +cannot explain in any detail) with the numeric literal defaulting mechanism. +For non-numeric literals the compiler can determine the correct types to use. + +If you omit type information for numeric literals, from GHC the error +message looks something like this: + + > Database/PostgreSQL/Test/Enumerator.lhs:194:4: + > Overlapping instances for Database.InternalEnumerator.DBBind a + > Session + > Database.PostgreSQL.PGEnumerator.PreparedStmt + > Database.PostgreSQL.PGEnumerator.BindObj + > arising from use of `bindP' at Database/PostgreSQL/Test/Enumerator.lhs:194:4-8 + > Matching instances: + > Imported from Database.PostgreSQL.PGEnumerator: + > instance (Database.InternalEnumerator.DBBind (Maybe a) + > Session + > Database.PostgreSQL.PGEnumerator.PreparedStmt + > Database.PostgreSQL.PGEnumerator.BindObj) => + > Database.InternalEnumerator.DBBind a + > Session + > Database.PostgreSQL.PGEnumerator.PreparedStmt + > Database.PostgreSQL.PGEnumerator.BindObj + > Imported from Database.PostgreSQL.PGEnumerator: + > instance Database.InternalEnumerator.DBBind (Maybe Double) + > .... + + +$usage_multiresultset + +Support for returning multiple result sets from a single +statement exists for PostgreSQL and Oracle. +Such functionality does not exist in Sqlite. + +The general idea is to invoke a database procedure or function which +returns cursor variables. The variables can be processed by +'Database.Enumerator.doQuery' in one of two styles: linear or nested. + +/Linear style:/ + +If we assume the existence of the following PostgreSQL function, +which is used in the test suite in "Database.PostgreSQL.Test.Enumerator": + + > CREATE OR REPLACE FUNCTION takusenTestFunc() RETURNS SETOF refcursor AS $$ + > DECLARE refc1 refcursor; refc2 refcursor; + > BEGIN + > OPEN refc1 FOR SELECT n*n from t_natural where n < 10 order by 1; + > RETURN NEXT refc1; + > OPEN refc2 FOR SELECT n, n*n, n*n*n from t_natural where n < 10 order by 1; + > RETURN NEXT refc2; + > END;$$ LANGUAGE plpgsql; + +... then this code shows how linear processing of cursors would be done: + + > withTransaction RepeatableRead $ do + > withPreparedStatement (prepareQuery "stmt1" (sql "select * from takusenTestFunc()") []) $ \pstmt -> do + > withBoundStatement pstmt [] $ \bstmt -> do + > dummy <- doQuery bstmt iterMain [] + > result1 <- doQuery (NextResultSet pstmt) iterRS1 [] + > result2 <- doQuery (NextResultSet pstmt) iterRS2 [] + > where + > iterMain :: (Monad m) => (RefCursor String) -> IterAct m [RefCursor String] + > iterMain c acc = result (acc ++ [c]) + > iterRS1 :: (Monad m) => Int -> IterAct m [Int] + > iterRS1 i acc = result (acc ++ [i]) + > iterRS2 :: (Monad m) => Int -> Int -> Int -> IterAct m [(Int, Int, Int)] + > iterRS2 i i2 i3 acc = result (acc ++ [(i, i2, i3)]) + +Notes: + + * the use of a 'Database.Enumerator.RefCursor' 'Data.Char.String' + type in the iteratee function indicates + to the backend that it should save each cursor value returned, + which it does by stuffing them into a list attached to the + prepared statement object. + This means that we /must/ use 'Database.Enumerator.withPreparedStatement' + to create a prepared statement object; the prepared statament oject + is the container for the cursors returned. + + * in this example we choose to discard the results of the first iteratee. + This is not necessary, but in this case the only column is a + 'Database.Enumerator.RefCursor', and the values are already saved + in the prepared statement object. + + * saved cursors are consumed one-at-a-time by calling 'Database.Enumerator.doQuery', + passing 'Database.Enumerator.NextResultSet' @pstmt@ + (i.e. passing the prepared statement oject wrapped by + 'Database.Enumerator.NextResultSet'). + This simply pulls the next cursor off the list + - they're processed in the order they were pushed on (FIFO) - + and processes it with the given iteratee. + + * if you try to process too many cursors i.e. make too many calls + to 'Database.Enumerator.doQuery' passing 'Database.Enumerator.NextResultSet' @pstmt@, + then an exception will be thrown. + OTOH, failing to process returned cursors will not raise errors, + but the cursors will remain open on the server according to whatever scoping + rules the sever applies. + For PostgreSQL, this will be until the transaction (or session) ends. + +/Nested style:/ + +The linear style of cursor processing is the only style supported by +MS SQL Server and ODBC (which we do not yet support). +However, PostgreSQL and Oracle also support using nested cursors in queries. + +Again for PostgreSQL, assuming we have these functions in the database: + + > CREATE OR REPLACE FUNCTION takusenTestFunc(lim int4) RETURNS refcursor AS $$ + > DECLARE refc refcursor; + > BEGIN + > OPEN refc FOR SELECT n, takusenTestFunc2(n) from t_natural where n < lim order by n; + > RETURN refc; + > END; $$ LANGUAGE plpgsql; + + > CREATE OR REPLACE FUNCTION takusenTestFunc2(lim int4) RETURNS refcursor AS $$ + > DECLARE refc refcursor; + > BEGIN + > OPEN refc FOR SELECT n from t_natural where n < lim order by n; + > RETURN refc; + > END; $$ LANGUAGE plpgsql; + +... then this code shows how nested queries might work: + + > selectNestedMultiResultSet = do + > let + > q = "SELECT n, takusenTestFunc(n) from t_natural where n < 10 order by n" + > iterMain (i::Int) (c::RefCursor String) acc = result' ((i,c):acc) + > iterInner (i::Int) (c::RefCursor String) acc = result' ((i,c):acc) + > iterInner2 (i::Int) acc = result' (i:acc) + > withTransaction RepeatableRead $ do + > rs <- doQuery (sql q) iterMain [] + > flip mapM_ rs $ \(outer, c) -> do + > rs <- doQuery c iterInner [] + > flip mapM_ rs $ \(inner, c) -> do + > rs <- doQuery c iterInner2 [] + > flip mapM_ rs $ \i -> do + > liftIO (putStrLn (show outer ++ " " ++ show inner ++ " " ++ show i)) + +Just to make it clear: the outer query returns a result-set that includes +a 'Database.Enumerator.RefCursor' column. Each cursor from that column is passed to +'Database.Enumerator.doQuery' to process it's result-set; +here we use 'Control.Monad.mapM_' to apply an IO action to the list returned by +'Database.Enumerator.doQuery'. + +For Oracle the example is slightly different. +The reason it's different is that: + + * Oracle requires that the parent cursor must remain open + while processing the children + (in the PostgreSQL example, 'Database.Enumerator.doQuery' + closes the parent cursor after constructing the list, + before the list is processed. This is OK because PostgreSQL + keeps the child cursors open on the server until they are explicitly + closed, or the transaction or session ends). + + * our current Oracle implementation prevents marshalling + of the cursor in the result-set buffer to a Haskell value, + so each fetch overwrites the buffer value with a new cursor. + This means you have to fully process a given cursor before + fetching the next one. + +Contrast this with the PostgreSQL example above, +where the entire result-set is processed to give a +list of RefCursor values, and then we run a list of actions +over this list with 'Control.Monad.mapM_'. +This is possible because PostgreSQL refcursors are just the +database cursor names, which are Strings, which we can marshal +to Haskell values easily. + + > selectNestedMultiResultSet = do + > let + > q = "select n, cursor(SELECT nat2.n, cursor" + > ++ " (SELECT nat3.n from t_natural nat3 where nat3.n < nat2.n order by n)" + > ++ " from t_natural nat2 where nat2.n < nat.n order by n)" + > ++ " from t_natural nat where n < 10 order by n" + > iterMain (outer::Int) (c::RefCursor StmtHandle) acc = do + > rs <- doQuery c (iterInner outer) [] + > result' ((outer,c):acc) + > iterInner outer (inner::Int) (c::RefCursor StmtHandle) acc = do + > rs <- doQuery c (iterInner2 outer inner) [] + > result' ((inner,c):acc) + > iterInner2 outer inner (i::Int) acc = do + > liftIO (putStrLn (show outer ++ " " ++ show inner ++ " " ++ show i)) + > result' (i:acc) + > withTransaction RepeatableRead $ do + > rs <- doQuery (sql q) iterMain [] + > return () + +Note that the PostgreSQL example can also be written like this +(except, of course, that the actual query text is that +from the PostgreSQL example). + + + +-------------------------------------------------------------------- +-- Haddock notes: +-------------------------------------------------------------------- + +The best way (that I've found) to get a decent introductory/explanatory +section for the module is to break the explanation into named chunks +(these begin with -- $<chunk-name>), +put the named chunks at the end, and reference them in the export list. + +You *can* write the introduction inline, as part of the module description, +but Haddock has no way to make headings. +Instead, if you make an explicit export-list then you can use +the "-- *", "-- **", etc, syntax to give section headings. + +(Note: if you don't use an explicit export list, then Haddock will use "-- *" etc +comments to make headings. The headings will appear in the docs in the the locations +as they do in the source, as do functions, data types, etc.) + + - One blank line continues a comment block. Two or more end it. + - The module comment must contain a empty line between "Portability: ..." and the description. + - bullet-lists: + - items must be preceded by an empty line. + - each list item must start with "*". + - code-sections: + - must be preceded by an empty line. + - use " >" rather than @...@, because "@" allows markup translation, where " >" doesn't. + - @inline code (monospaced font)@ + - /emphasised text/ + - links: "Another.Module", 'someIdentifier' (same module), + 'Another.Module.someIdentifier', <http:/www.haskell.org/haddock> +
+ Database/InternalEnumerator.lhs view
@@ -0,0 +1,262 @@+ +| +Module : Database.InternalEnumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +This is the interface between the middle Enumerator layer and the +low-level, Database-specific layer. This file is not exported to the end user. + +Only the programmer for a new back-end needs to consult this file. + +> {-# OPTIONS -fglasgow-exts #-} + +> module Database.InternalEnumerator +> ( +> -- * Session object. +> ISession(..), ConnectA(..) +> , Statement(..), Command(..), EnvInquiry(..) +> , PreparationA(..), IPrepared(..) +> , BindA(..), DBBind(..) +> , IsolationLevel(..) +> , Position +> , IQuery(..) +> , DBType(..) +> , throwIfDBNull +> -- * Exceptions and handlers +> , DBException(..) +> , throwDB +> , ColNum, RowNum +> , SqlState, SqlStateClass, SqlStateSubClass +> ) where + +> import Data.Typeable +> import Control.Exception (throw, catchDyn, +> dynExceptions, throwDyn, throwIO, bracket, Exception) +> import qualified Control.Exception (catch) + +> data IsolationLevel = +> ReadUncommitted +> | ReadCommitted +> | RepeatableRead +> | Serialisable +> | Serializable -- ^ for alternative spellers +> deriving Show + + +| A wrapper around the action to open the database. That wrapper is not +exported to the end user. The only reason for the wrapper is to +guarantee that the only thing to do with the result of +'Database.Enumerator.Sqlite.connect' function is to pass it out +directly to 'Database.Enumerator.withSession'. + +> newtype ConnectA sess = ConnectA (IO sess) deriving Typeable + + + +Position within the result set. Not for the end user. + +> type Position = Int + +Needed for exceptions + +> type RowNum = Int +> type ColNum = Int + +-------------------------------------------------------------------- +-- ** Exceptions and handlers +-------------------------------------------------------------------- + +> type SqlStateClass = String +> type SqlStateSubClass = String +> type SqlState = (SqlStateClass, SqlStateSubClass) + +> data DBException +> -- | DBMS error message. +> = DBError SqlState Int String +> | DBFatal SqlState Int String +> -- | the iteratee function used for queries accepts both nullable (Maybe) and +> -- non-nullable types. If the query itself returns a null in a column where a +> -- non-nullable type was specified, we can't handle it, so DBUnexpectedNull is thrown. +> | DBUnexpectedNull RowNum ColNum +> -- | Thrown by cursor functions if you try to fetch after the end. +> | DBNoData +> deriving (Typeable, Show) + +| Throw a DBException. It's just a type-specific 'Control.Exception.throwDyn'. + +> throwDB :: DBException -> a +> throwDB = throwDyn + + +-------------------------------------------------------------------- +-- ** Session interface +-------------------------------------------------------------------- + +| The 'ISession' class describes a database session to a particular +DBMS. Oracle has its own Session object, SQLite has its own +session object (which maintains the connection handle to the database +engine and other related stuff). Session objects for different databases +normally have different types -- yet they all belong to the class ISession +so we can do generic operations like @commit@, @execDDL@, etc. +in a database-independent manner. + +Session objects per se are created by database connection\/login functions. + +The class 'ISession' is thus an interface between low-level (and +database-specific) code and the Enumerator, database-independent +code. +The 'ISession' class is NOT visible to the end user -- neither the class, +nor any of its methods. + +The 'ISession' class describes the mapping from connection object to +the session object. The connection object is created by the end user +(and this is how the end user tells which particular back end he wants). +The session object is not accessible by the end user in any way. +Even the type of the session object should be hidden! + +> class ISession sess where +> disconnect :: sess -> IO () +> beginTransaction :: sess -> IsolationLevel -> IO () +> commit :: sess -> IO () +> rollback :: sess -> IO () + + +We can have several types of statements: just plain strings, +strings bundled with tuning parameters, prepared statements. +BTW, statement with unbound variables should have a different type +from that of the statement without bound variables or the statement +with all bound variables. + +| 'Command' is not a query: command deletes or updates rows, creates\/drops +tables, or changes database state. +'executeCommand' returns the number of affected rows (or 0 if DDL i.e. not DML). + +> class ISession sess => Command stmt sess where +> -- insert/update/delete; returns number of rows affected +> executeCommand :: sess -> stmt -> IO Int + +> class ISession sess => +> EnvInquiry inquirykey sess result | inquirykey sess -> result where +> inquire :: inquirykey -> sess -> IO result + + +| 'Statement' defines the API for query objects i.e. +which types can be queries. + +> class ISession sess => Statement stmt sess q | stmt sess -> q where +> makeQuery :: sess -> stmt -> IO q + + +|The class IQuery describes the class of query objects. Each +database (that is, each Session object) has its own Query object. +We may assume that a Query object includes (at least, conceptually) +a (pointer to) a Session object, so a Query object determines the +Session object. +A back-end provides an instance (or instances) of IQuery. +The end user never seens the IQuery class (let alone its methods). + +Can a session have several types of query objects? +Let's assume that it can: but a statement plus the session uniquely +determine the query, + +Note that we explicitly use IO monad because we will have to explicitly +do FFI. + +> class ISession sess => IQuery q sess b | q -> sess, q -> b +> where +> fetchOneRow :: q -> IO Bool +> currentRowNum :: q -> IO Int +> freeBuffer :: q -> b -> IO () +> destroyQuery :: q -> IO () + +|A \'buffer\' means a column buffer: a data structure that points to a +block of memory allocated for the values of one particular +column. Since a query normally fetches a row of several columns, we +typically deal with a list of column buffers. Although the column data +are typed (e.g., Integer, CalendarDate, etc), column buffers hide that +type. Think of the column buffer as Dynamics. The class DBType below +describes marshalling functions, to fetch a typed value out of the +\'untyped\' columnBuffer. + +Different DBMS's (that is, different session objects) have, in +general, columnBuffers of different types: the type of Column Buffer +is specific to a database. +So, ISession (m) uniquely determines the buffer type (b)?? +Or, actually, a query uniquely determines the buffer. + + +| The class DBType is not used by the end-user. +It is used to tie up low-level database access and the enumerator. +A database-specific library must provide a set of instances for DBType. + +> class DBType a q b | q -> b where +> allocBufferFor :: a -> q -> Position -> IO b +> fetchCol :: q -> b -> IO a + +| Used by instances of DBType to throw an exception +when a null (Nothing) is returned. +Will work for any type, as you pass the fetch action in the fetcher arg. + +> throwIfDBNull :: (Monad m) => m (RowNum, ColNum) -> m (Maybe a) -> m a +> throwIfDBNull pos fetcher = do +> v <- fetcher +> case v of +> Nothing -> do +> (row,col) <- pos +> throwDB (DBUnexpectedNull row col) +> Just m -> return m + + + +------------------------------------------------------------------------ +Prepared commands and statements + + +| This type is not visible to the end user (cf. ConnectA). It forms a private +`communication channel' between Database.Enumerator and a back end. + +Why don't we make a user-visible class with a @prepare@ method? +Because it means to standardize the preparation method signature +across all databases. Some databases need more parameters, some +fewer. There may be several statement preparation functions within one +database. So, instead of standardizing the signature of the +preparation function, we standardize on the _result_ of that +function. To be more precise, we standardize on the properties of the +result: whatever it is, the eventual prepared statement should be +suitable to be passed to 'bindRun'. + +> newtype PreparationA sess stmt = PreparationA (sess -> IO stmt) + + +> class ISession sess => IPrepared stmt sess bound_stmt bo +> | stmt -> bound_stmt, stmt -> bo where +> bindRun :: sess -> stmt -> [BindA sess stmt bo] -> (bound_stmt -> IO a) -> IO a +> -- Should this be here? we have a need to free statements +> -- separately from result-sets (which are handled by IQuery.destroyQuery). +> -- It might be useful to prepare a statement, use it a number of times +> -- (so many result-sets are created+destroyed), and then destroy it, +> -- so it has a lifecycle independent of Queries. +> destroyStmt :: sess -> stmt -> IO () + +| The binding object (bo) below is very abstract, on purpose. +It may be |IO a|, it may be String, it may be a function, etc. +The binding object can hold the result of marshalling, +or bo can hold the current counter, etc. +Different databases do things very differently: +compare PostgreSQL and the Stub (which models Oracle). + +> newtype BindA sess stmt bo = BindA (sess -> stmt -> bo) + +| The class DBBind is not used by the end-user. +It is used to tie up low-level database access and the enumerator. +A database-specific library must provide a set of instances for DBBind. +The latter are the dual of DBType. + +> class ISession sess => DBBind a sess stmt bo | stmt -> bo where +> -- | This is really just a wrapper that lets us write lists of +> -- heterogenous bind values e.g. @[bindP "string", bindP (0::Int), ...]@ +> bindP :: a -> BindA sess stmt bo
+ Database/MSSqlServer/MSSqlFunctions.lhs view
@@ -0,0 +1,93 @@+ +| +Module : Database.MSSqlServer.MSSqlFunctions +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Simple wrappers for MS Sql Server functions (FFI). + + > -L"C:\Program Files\Common Files\System\Ole DB" -lsqloledb + +Don't forget to specify the header file location +(or wherever your Sql Server installation resides): + + > "-IC:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include" + + +> {-# OPTIONS -ffi #-} +> {-# OPTIONS -fglasgow-exts #-} + +From C:\WINDOWS\hh.exe "C:\Program Files\Microsoft SQL Server\80\Tools\Books\SQL80.col" + -- Compiling OLE DB Applications -- +"Most applications use wide character strings to make OLE DB function calls. +If applications are using TCHAR variables, the application must include +#define UNICODE in the application. It converts the TCHAR variables to +wide character strings." + +> {-# OPTIONS -optc-DUNICODE #-} + +Do we need this? + {-# OPTIONS -#include "windows.h" #-} + +> {-# OPTIONS -#include "sqloledb.h" #-} +> {-# OPTIONS -#include "oledberr.h" #-} + +Don't need to explcitly include sqldb.h, as it's implied by the +FFI foreign import declarations e.g. + > foreign import ccall "oledb.h dbinit" dbInit :: IO CString +implies + {- # OPTIONS -#include "oledb.h" #-} + + +> module Database.MSSqlServer.MSSqlFunctions where + +> import Foreign +> import Foreign.C +> import Control.Monad +> import Control.Exception +> import Data.Dynamic +> import Data.Int +> import Data.IORef + + + +> data MSSqlException = MSSqlException Int String +> deriving (Typeable, Eq) + +> instance Show MSSqlException where +> show (MSSqlException i s) = "MSSqlException " ++ (show i) ++ " " ++ s + +> makeEx :: CInt -> String -> MSSqlException +> makeEx e msg = MSSqlException (fromIntegral e) msg + +> catchMSSql :: IO a -> (MSSqlException -> IO a) -> IO a +> catchMSSql = catchDyn + +> throwMSSql :: MSSqlException -> a +> throwMSSql = throwDyn + +> throwEx :: CInt -> String -> IO a +> throwEx e msg = throwMSSql (makeEx e msg) + +> testForError :: CInt -> String -> a -> IO a +> testForError rc msg retval = do +> case () of +> _ | rc == dbSUCCEED -> return retval +> | otherwise -> throwEx rc msg + +> errorOnNull :: Ptr b -> String -> a -> IO a +> errorOnNull ptr msg retval = do +> if ptr == nullPtr +> then throwEx (-1 ) msg +> else return retval + +> cStr :: CStringLen -> CString +> cStr = fst +> cStrLen :: CStringLen -> CInt +> cStrLen = fromIntegral . snd + + + foreign import ccall "sqldb.h dbinit" dbInit :: IO CString
+ Database/MSSqlServer/Test/Enumerator.lhs view
@@ -0,0 +1,32 @@+ +| +Module : Database.MSSqlServer.Test.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +> {-# OPTIONS -fglasgow-exts -fallow-overlapping-instances #-} + +> module Database.MSSqlServer.Test.Enumerator (runTest) where + +> --import qualified Database.MSSqlServer.Enumerator as MSSql (connect, disconnect) +> import qualified Database.MSSqlServer.Test.MSSqlFunctions as Low +> import Database.Test.Enumerator as Enum +> import Database.Test.Performance as Perf +> import Database.Enumerator +> import Control.Monad (when) + + +> runTest :: Perf.ShouldRunTests -> [String] -> IO () +> runTest runPerf args = catchDB ( do +> let [user, pswd, dbname ] = args +> Low.runTest args +> {- +> sess <- MSSql.connect user pswd dbname +> Enum.runTests dateMSSql sess +> when (runPerf == Perf.RunTests) (Perf.runTests sess) +> MSSql.disconnect sess +> -} +> ) basicDBExceptionReporter
+ Database/MSSqlServer/Test/MSSqlFunctions.lhs view
@@ -0,0 +1,79 @@+ +| +Module : Database.MSSqlServer.Test.MSSqlFunctions +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + + +> {-# OPTIONS -fglasgow-exts #-} + + +> module Database.MSSqlServer.Test.MSSqlFunctions (runTest) where + +> import Prelude hiding (catch) +> import Foreign +> import Foreign.C +> import Control.Monad +> import Control.Exception +> import Data.Dynamic +> import Database.MSSqlServer.MSSqlFunctions +> import System.Environment (getArgs) +> import Test.HUnit +> import Data.IORef + + +> nullException = MSSqlException 0 "" + +> runTest :: [String] -> IO () +> runTest args = do +> ex <- newIORef nullException +> printIgnoreError ex $ do +> let [ usr, pwd, dbase, svr ] = args +> putStrLn "init" +> dbInit +> putStrLn "install error handler" +> enableErrorHandler ex +> putStrLn "open" +> sess <- open usr pwd dbase svr +> putStrLn "exec" +> execQuery sess "select 'hello'" +> putStrLn "fetch" +> rc <- fetchRow sess +> putStrLn "value" +> s <- colValString sess 1 +> putStrLn s +> putStrLn "cancel" +> dbCancel sess +> putStrLn "close" +> dbClose sess +> putStrLn "exit" +> dbExit +> return () + + +> testlist db = TestList $ map (\t -> TestCase (t db)) +> [ ] + +> ignoreError :: IO () -> IO () +> ignoreError action = +> catchMSSql action (\e -> return ()) + +> printIgnoreError :: IORef MSSqlException -> IO () -> IO () +> printIgnoreError refex action = catchMSSql action +> (\e -> do +> realEx <- readIORef refex +> let ex = if realEx == nullException then e else realEx +> putStrLn (show ex) +> ) + +> printPropagateError :: IORef MSSqlException -> IO a -> IO a +> printPropagateError refex action = catchMSSql action +> (\e -> do +> realEx <- readIORef refex +> let ex = if realEx == nullException then e else realEx +> putStrLn (show ex) +> throwMSSql ex +> )
+ Database/ODBC/Enumerator.lhs view
@@ -0,0 +1,404 @@+ +| +Module : Database.ODBC.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +ODBC implementation of Database.Enumerator. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-undecidable-instances #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.ODBC.Enumerator +> ( Session, connect +> , prepareStmt, preparePrefetch +> , prepareQuery, prepareLargeQuery, prepareCommand +> , sql, sqlbind, prefetch, cmdbind +> , module Database.Enumerator +> ) +> where + + +> import Database.Enumerator +> import Database.InternalEnumerator +> import Database.Util +> import Foreign.C +> import Foreign.Storable (sizeOf) +> import Control.Monad +> import Control.Exception +> import Database.ODBC.OdbcFunctions +> (EnvHandle, ConnHandle, StmtHandle, OdbcException(..), catchOdbc, throwOdbc) +> import qualified Database.ODBC.OdbcFunctions as DBAPI +> import Control.Monad.Trans +> import Control.Monad.Reader +> import Data.Dynamic +> import Data.IORef +> import Data.Int +> import System.Time +> import Data.Time + + + +-------------------------------------------------------------------- +-- ** API Wrappers +-------------------------------------------------------------------- + +|These wrappers ensure that only DBExceptions are thrown, +and never SqliteExceptions. +We don't need wrappers for the colValXxx functions +because they never throw exceptions. + + +> convertAndRethrow :: OdbcException -> IO a +> convertAndRethrow (OdbcException e st m exs) = do +> let +> statepair@(stateclass, statesubclass) = (take 2 st, drop 2 st) +> ec = case stateclass of +> "XX" -> DBFatal +> "58" -> DBFatal +> "57" -> DBFatal +> "54" -> DBFatal +> "53" -> DBFatal +> "08" -> DBFatal +> _ -> DBError +> throwDB (ec statepair e m) + + +|Common case: wrap an action with a convertAndRethrow. + +> convertEx :: IO a -> IO a +> convertEx action = catchOdbc action convertAndRethrow + +> stmtPrepare :: ConnHandle -> String -> IO StmtHandle +> stmtPrepare conn sqltext = convertEx $ do +> stmt <- DBAPI.allocStmt conn +> DBAPI.prepareStmt stmt sqltext +> return stmt + +> stmtExecute :: StmtHandle -> IO () +> stmtExecute stmt = convertEx (DBAPI.executeStmt stmt) + +> closeCursor :: StmtHandle -> IO () +> closeCursor stmt = convertEx (DBAPI.closeCursor stmt) + +> fetchRow :: StmtHandle -> IO Bool +> fetchRow stmt = convertEx (DBAPI.fetch stmt) + +> rowCount :: StmtHandle -> IO Int +> rowCount stmt = convertEx (DBAPI.rowCount stmt) + +> freeStmt stmt = convertEx (DBAPI.freeStmt stmt) +> freeConn conn = convertEx (DBAPI.freeConn conn) +> freeEnv env = convertEx (DBAPI.freeEnv env) + +> connectDb connstr = convertEx $ do +> env <- DBAPI.allocEnv +> DBAPI.setOdbcVer env +> conn <- DBAPI.allocConn env +> connstr <- DBAPI.connect conn connstr +> DBAPI.setAutoCommitOff conn +> return (env, conn) + +> disconnectDb conn = convertEx (DBAPI.disconnect conn) + +> commitTrans conn = convertEx (DBAPI.commit conn) +> rollbackTrans conn = convertEx (DBAPI.rollback conn) + +> setTransLevel conn level = convertEx (DBAPI.setTxnIsolation conn level) + +-------------------------------------------------------------------- +-- ** Sessions +-------------------------------------------------------------------- + +We don't need much in a Session record. +Session objects are created by 'connect'. + +> data Session = Session +> { envHandle :: EnvHandle +> , connHandle :: ConnHandle } +> deriving Typeable + +> connect :: String -> ConnectA Session +> connect connstr = ConnectA $ do +> (env, conn) <- connectDb connstr +> return (Session env conn) + +-------------------------------------------------------------------- +-- Statements and Commands +-------------------------------------------------------------------- + +> newtype QueryString = QueryString String + +> sql :: String -> QueryString +> sql str = QueryString str + +> instance Command QueryString Session where +> executeCommand sess (QueryString str) = executeCommand sess str + +> instance Command String Session where +> executeCommand sess str = do +> stmt <- stmtPrepare (connHandle sess) str +> stmtExecute stmt +> n <- rowCount stmt +> freeStmt stmt +> return (fromIntegral n) + +> instance Command BoundStmt Session where +> executeCommand sess (BoundStmt pstmt) = +> rowCount (stmtHandle pstmt) + +> instance Command StmtBind Session where +> executeCommand sess (StmtBind sqltext bas) = do +> let (PreparationA action) = prepareStmt' sqltext FreeManually +> pstmt <- action sess +> sequence_ (zipWith (\i (BindA ba) -> ba sess pstmt i) [1..] bas) +> let stmt = stmtHandle pstmt +> stmtExecute stmt +> n <- rowCount stmt +> freeStmt stmt +> return n + +Note: the PostgreSQL ODBC driver only supports ReadCommitted +and Serializable. It throws an error on other values. +It'd be nicer if it just silently upgraded, but c'est la vie... + +Apparently MS SQL Server upgrades RepeatableRead to Serializable. +Presumably the other modes are still supported. + +> isolationLevel ReadUncommitted = DBAPI.sqlTxnReadUncommitted +> isolationLevel ReadCommitted = DBAPI.sqlTxnReadCommitted +> isolationLevel RepeatableRead = DBAPI.sqlTxnRepeatableRead +> isolationLevel Serialisable = DBAPI.sqlTxnSerializable +> isolationLevel Serializable = DBAPI.sqlTxnSerializable + +> instance ISession Session where +> disconnect sess = do +> disconnectDb (connHandle sess) +> freeConn (connHandle sess) +> freeEnv (envHandle sess) +> -- With ODBC, transactions are implicitly started. +> beginTransaction sess isolation = do +> commitTrans (connHandle sess) +> setTransLevel (connHandle sess) (isolationLevel isolation) +> commit sess = commitTrans (connHandle sess) +> rollback sess = rollbackTrans (connHandle sess) + +About stmtFreeWithQuery: + +We need to keep track of the scope of the PreparedStmtObj +i.e. should it be freed when the Query (result-set) is freed, +or does it have a longer lifetime? +PreparedStmts created by prepareStmt have a lifetime possibly +longer than the result-set; users should use withPreparedStatement +to manage these. + +PreparedStmts can also be created internally by various instances +of makeQuery (in class Statement), and these will usually have the +same lifetime/scope as that of the Query (result-set). + +This lifetime distinction should probably be handled by having +separate types for the two types of prepared statement... + +> data StmtLifetime = FreeWithQuery | FreeManually + +> data PreparedStmtObj = PreparedStmtObj +> { stmtHandle :: StmtHandle +> , stmtLifetime :: StmtLifetime +> } + +> prepareStmt :: QueryString -> PreparationA Session PreparedStmtObj +> prepareStmt (QueryString sqltext) = prepareStmt' sqltext FreeManually + +> prepareQuery :: QueryString -> PreparationA Session PreparedStmtObj +> prepareQuery (QueryString sqltext) = prepareStmt' sqltext FreeManually + +> prepareLargeQuery :: Int -> QueryString -> PreparationA Session PreparedStmtObj +> prepareLargeQuery _ (QueryString sqltext) = prepareStmt' sqltext FreeManually + +> prepareCommand :: QueryString -> PreparationA Session PreparedStmtObj +> prepareCommand (QueryString sqltext) = prepareStmt' sqltext FreeManually + + +preparePrefetch is just here for interface consistency +with Oracle and PostgreSQL. + +> preparePrefetch :: Int -> QueryString -> PreparationA Session PreparedStmtObj +> preparePrefetch count (QueryString sqltext) = +> prepareStmt' sqltext FreeManually + +> prepareStmt' sqltext free = +> PreparationA (\sess -> do +> stmt <- stmtPrepare (connHandle sess) sqltext +> return (PreparedStmtObj stmt free)) + +-------------------------------------------------------------------- +-- ** Binding +-------------------------------------------------------------------- + +> newtype BoundStmt = BoundStmt { boundStmt :: PreparedStmtObj } +> type BindObj = Int -> IO () + +> instance IPrepared PreparedStmtObj Session BoundStmt BindObj where +> bindRun sess pstmt bas action = do +> sequence_ (zipWith (\i (BindA ba) -> ba sess pstmt i) [1..] bas) +> let stmt = stmtHandle pstmt +> stmtExecute stmt +> action (BoundStmt pstmt) +> destroyStmt sess pstmt = freeStmt (stmtHandle pstmt) + +> instance DBBind (Maybe String) Session PreparedStmtObj BindObj where +> bindP val = makeBindAction val DBAPI.bindParamBuffer + +> instance DBBind (Maybe Int) Session PreparedStmtObj BindObj where +> bindP val = makeBindAction val DBAPI.bindParamBuffer + +> instance DBBind (Maybe Double) Session PreparedStmtObj BindObj where +> bindP val = makeBindAction val DBAPI.bindParamBuffer + +> instance DBBind (Maybe UTCTime) Session PreparedStmtObj BindObj where +> bindP val = makeBindAction val DBAPI.bindParamBuffer + +> instance DBBind (Maybe a) Session PreparedStmtObj BindObj +> => DBBind a Session PreparedStmtObj BindObj where +> bindP x = bindP (Just x) + +The default instance, uses generic Show + +> instance (Show a) => DBBind (Maybe a) Session PreparedStmtObj BindObj where +> bindP (Just x) = bindP (Just (show x)) +> bindP Nothing = bindP (Nothing `asTypeOf` Just "") + +> makeBindAction val binder = BindA (\ses st pos -> do +> convertEx (binder (stmtHandle st) pos val >> return ())) + +-------------------------------------------------------------------- +-- ** Queries +-------------------------------------------------------------------- + +> data Query = Query +> { queryStmt :: PreparedStmtObj +> , querySess :: Session +> , queryCount :: IORef Int +> } + +> data StmtBind = StmtBind String [BindA Session PreparedStmtObj BindObj] + +> sqlbind :: String -> [BindA Session PreparedStmtObj BindObj] -> StmtBind +> sqlbind sql bas = StmtBind sql bas + +> cmdbind :: String -> [BindA Session PreparedStmtObj BindObj] -> StmtBind +> cmdbind sql bas = StmtBind sql bas + +> prefetch :: Int -> String -> [BindA Session PreparedStmtObj BindObj] -> StmtBind +> prefetch n sql bas = StmtBind sql bas + + +> instance Statement BoundStmt Session Query where +> makeQuery sess bstmt = do +> n <- newIORef 0 +> return (Query (boundStmt bstmt) sess n) + +> instance Statement PreparedStmtObj Session Query where +> makeQuery sess pstmt = do +> stmtExecute (stmtHandle pstmt) +> n <- newIORef 0 +> return (Query pstmt sess n) + +> instance Statement StmtBind Session Query where +> makeQuery sess (StmtBind sqltext bas) = do +> let (PreparationA action) = prepareStmt' sqltext FreeWithQuery +> pstmt <- action sess +> sequence_ (zipWith (\i (BindA ba) -> ba sess pstmt i) [1..] bas) +> stmtExecute (stmtHandle pstmt) +> n <- newIORef 0 +> return (Query pstmt sess n) + +> instance Statement QueryString Session Query where +> makeQuery sess (QueryString sqltext) = makeQuery sess sqltext + +> instance Statement String Session Query where +> makeQuery sess sqltext = do +> let (PreparationA action) = prepareStmt' sqltext FreeWithQuery +> pstmt <- action sess +> stmtExecute (stmtHandle pstmt) +> n <- newIORef 0 +> return (Query pstmt sess n) + + +> instance IQuery Query Session ColumnBuffer where +> destroyQuery query = do +> closeCursor (stmtHandle (queryStmt query)) +> case stmtLifetime (queryStmt query) of +> FreeWithQuery -> freeStmt (stmtHandle (queryStmt query)) +> FreeManually -> return () +> fetchOneRow query = do +> moreRows <- fetchRow (stmtHandle (queryStmt query)) +> modifyIORef (queryCount query) (+1) +> return moreRows +> currentRowNum q = readIORef (queryCount q) +> freeBuffer q buffer = return () + + +> nullIf :: Bool -> a -> Maybe a +> nullIf test v = if test then Nothing else Just v + +> --bufferToString buffer = +> -- convertEx (DBAPI.getUTF8StringFromBuffer (colBuffer buffer)) + + +> data ColumnBuffer = ColumnBuffer +> { colPos :: Int +> , colBuffer :: DBAPI.BindBuffer +> } + +> allocBuffer q pos size val = do +> --putStrLn ("allocBuffer: pos " ++ show pos ++ ", size " ++ show size) +> bindbuffer <- convertEx (DBAPI.bindColBuffer (stmtHandle (queryStmt q)) pos size val) +> return (ColumnBuffer pos bindbuffer) + +> buffer_pos q buffer = do +> row <- currentRowNum q +> return (row,colPos buffer) + + +> instance DBType (Maybe String) Query ColumnBuffer where +> allocBufferFor v q n = allocBuffer q n 32000 v +> fetchCol q buffer = convertEx (DBAPI.getFromBuffer (colBuffer buffer)) + +> instance DBType (Maybe Int) Query ColumnBuffer where +> allocBufferFor v q n = allocBuffer q n 0 v +> fetchCol q buffer = convertEx (DBAPI.getFromBuffer (colBuffer buffer)) + +> instance DBType (Maybe Double) Query ColumnBuffer where +> allocBufferFor v q n = allocBuffer q n 0 v +> fetchCol q buffer = convertEx (DBAPI.getFromBuffer (colBuffer buffer)) + +> instance DBType (Maybe UTCTime) Query ColumnBuffer where +> allocBufferFor v q n = allocBuffer q n 32 v +> fetchCol q buffer = convertEx (DBAPI.getFromBuffer (colBuffer buffer)) + + +|This single polymorphic instance replaces all of the type-specific non-Maybe instances +e.g. String, Int, Double, etc. + +> instance DBType (Maybe a) Query ColumnBuffer +> => DBType a Query ColumnBuffer where +> allocBufferFor v q n = allocBufferFor (Just v) q n +> fetchCol q buffer = throwIfDBNull (buffer_pos q buffer) (fetchCol q buffer) + + +|This polymorphic instance assumes that the value is in a String column, +and uses Read to convert the String to a Haskell data value. + +> instance (Show a, Read a) => DBType (Maybe a) Query ColumnBuffer where +> allocBufferFor v q n = allocBuffer q n 32000 (Just "") +> fetchCol q buffer = do +> v <- convertEx (DBAPI.getFromBuffer (colBuffer buffer)) +> case v of +> Just s -> if s == "" then return Nothing else return (Just (read s)) +> Nothing -> return Nothing
+ Database/ODBC/OdbcFunctions.hsc view
@@ -0,0 +1,945 @@+ +{-# OPTIONS -ffi #-} +{-# OPTIONS -fglasgow-exts #-} +{-# LANGUAGE ForeignFunctionInterface #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} + +#ifdef mingw32_HOST_OS +#include <windows.h> +#endif +#include <sql.h> +#include <sqlext.h> + +#ifdef mingw32_HOST_OS +#let CALLCONV = "stdcall" +#else +#let CALLCONV = "ccall" +#endif + +{- +http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcodbc_api_reference.asp +http://www.dbmaker.com.tw/reference/manuals/odbc/odbc_chap_04.html +-} + + +-- | +-- Module : Database.ODBC.OdbcFunctions +-- Copyright : (c) 2007 Oleg Kiselyov, Alistair Bayley +-- License : BSD-style +-- Maintainer : oleg@pobox.com, alistair@abayley.org +-- Stability : experimental +-- Portability : non-portable +-- +-- Wrappers for ODBC FFI functions, plus buffer marshaling. + +module Database.ODBC.OdbcFunctions where + +import Control.Exception +import Control.Monad +import Data.Dynamic +import Data.Time +import Database.Util +import Foreign +import Foreign.C +import Foreign.C.UTF8 + +data HandleObj = HandleObj +type Handle = Ptr HandleObj +data EnvObj = EnvObj +type EnvHandle = Ptr EnvObj +data ConnObj = ConnObj +type ConnHandle = Ptr ConnObj +data StmtObj = StmtObj +type StmtHandle = Ptr StmtObj +type WindowHandle = Ptr () +data Buffer = Buffer +type BufferFPtr = ForeignPtr Buffer +type SizeFPtr = ForeignPtr SqlLen + +data BindBuffer = BindBuffer + { bindBufPtr :: BufferFPtr + , bindBufSzPtr :: SizeFPtr + , bindBufSize :: SqlLen + } + +type SqlInteger = #{type SQLINTEGER} +type SqlUInteger = #{type SQLUINTEGER} +type SqlSmallInt = #{type SQLSMALLINT} +type SqlUSmallInt = #{type SQLUSMALLINT} +type SqlLen = #{type SQLLEN} +type SqlULen = #{type SQLULEN} +type SqlReturn = SqlSmallInt +type SqlHandleType = SqlSmallInt +type SqlDataType = SqlSmallInt +type SqlCDataType = SqlSmallInt +type SqlParamDirection = SqlSmallInt + +-- Return codes from API calls + +( + sqlRcInvalidHandle : + sqlRcStillExecuting : + sqlRcSuccess : + sqlRcSuccessWithInfo : + sqlRcError : + sqlRcNeedData : + sqlRcNoData : +-- []) = [-2,-1,0,1,2,99,100] :: [SqlReturn] + []) = + ( + #{const SQL_INVALID_HANDLE} : + #{const SQL_STILL_EXECUTING} : + #{const SQL_SUCCESS} : + #{const SQL_SUCCESS_WITH_INFO} : + #{const SQL_ERROR} : + #{const SQL_NEED_DATA} : + #{const SQL_NO_DATA} : + []) :: [SqlReturn] + +showReturnCode rc + | rc == #{const SQL_INVALID_HANDLE} = "SQL_INVALID_HANDLE" + | rc == #{const SQL_STILL_EXECUTING} = "SQL_STILL_EXECUTING" + | rc == #{const SQL_SUCCESS} = "SQL_SUCCESS" + | rc == #{const SQL_SUCCESS_WITH_INFO} = "SQL_SUCCESS_WITH_INFO" + | rc == #{const SQL_ERROR} = "SQL_ERROR" + | rc == #{const SQL_NEED_DATA} = "SQL_NEED_DATA" + | rc == #{const SQL_NO_DATA} = "SQL_NO_DATA" + | otherwise = "UNKNOWN_RETURN_CODE" + +-- There are only four handle types in ODBC. + +( + sqlHTypeEnv : + sqlHTypeConn : + sqlHTypeStmt : + sqlHTypeDesc : +-- []) = [1..4] :: [SqlHandleType] + []) = + ( + #{const SQL_HANDLE_ENV} : + #{const SQL_HANDLE_DBC} : + #{const SQL_HANDLE_STMT} : + #{const SQL_HANDLE_DESC} : + []) :: [SqlHandleType] + +sqlDriverNoPrompt :: SqlUSmallInt +sqlDriverNoPrompt = #{const SQL_DRIVER_NOPROMPT} + +sqlNullTermedString :: SqlInteger +sqlNullTermedString = #{const SQL_NTS} + +sqlNullData :: SqlLen +sqlNullData = #{const SQL_NULL_DATA} + +sqlTransCommit :: SqlSmallInt +sqlTransCommit = #{const SQL_COMMIT} + +sqlTransRollback :: SqlSmallInt +sqlTransRollback = #{const SQL_ROLLBACK} + +sqlAutoCommitOn, sqlAutoCommitOff :: SqlInteger +sqlAutoCommitOn = #{const SQL_AUTOCOMMIT_ON} +sqlAutoCommitOff = #{const SQL_AUTOCOMMIT_OFF} + +-- These are attribute types, which are passed as the second parameter +-- to sqlSetEnvAttr. + +( + sqlAttrOdbcVersion : + sqlAttrAutoCommit : + sqlAttrTxnIsolation : + []) = + ( + #{const SQL_ATTR_ODBC_VERSION} : + #{const SQL_ATTR_AUTOCOMMIT} : + #{const SQL_ATTR_TXN_ISOLATION} : + []) :: [SqlInteger] + +-- These are attribute values, which are passed as the third parameter +-- to sqlSetEnvAttr. Obviously that must accompany the relevant +-- attribute type. + +( + sqlOvOdbc3 : + sqlTxnCapable : + sqlDefaultTxnIsolation : + sqlTxnIsolationOption : + sqlTxnReadUncommitted : + sqlTxnReadCommitted : + sqlTxnRepeatableRead : + sqlTxnSerializable : + []) = + ( + #{const SQL_OV_ODBC3} : -- 3 (UL) + #{const SQL_TXN_CAPABLE} : -- 46 + #{const SQL_DEFAULT_TXN_ISOLATION} : -- 26 + #{const SQL_TXN_ISOLATION_OPTION} : -- 72 + #{const SQL_TXN_READ_UNCOMMITTED} : -- 1 + #{const SQL_TXN_READ_COMMITTED} : -- 2 + #{const SQL_TXN_REPEATABLE_READ} : -- 4 + #{const SQL_TXN_SERIALIZABLE} : -- 8 + []) :: [SqlInteger] + + +-- ODBC SQL data types +( + sqlDTypeString : + sqlDTypeInt : + sqlDTypeBinary : + sqlDTypeDouble : + sqlDTypeDate : + sqlDTypeTime : + sqlDTypeTimestamp : + sqlDTypeCursor : + []) = + ( + #{const SQL_CHAR} : -- 1 + #{const SQL_INTEGER} : -- 4 + #{const SQL_BINARY} : -- -2 + #{const SQL_DOUBLE} : -- 8 + #{const SQL_TYPE_DATE} : -- 9 + #{const SQL_TYPE_TIME} : -- 10 + #{const SQL_TYPE_TIMESTAMP} : -- 11 + #{const SQL_CURSOR_TYPE} : -- 6 + []) :: [SqlDataType] + +-- host language (C) data types + +( + sqlCTypeString : + sqlCTypeInt : + sqlCTypeBinary : + sqlCTypeDouble : + sqlCTypeDate : + sqlCTypeTime : + sqlCTypeTimestamp : + []) = + ( + #{const SQL_C_CHAR} : + #{const SQL_C_LONG} : + #{const SQL_C_BINARY} : + #{const SQL_C_DOUBLE} : + #{const SQL_C_TYPE_DATE} : + #{const SQL_C_TYPE_TIME} : + #{const SQL_C_TYPE_TIMESTAMP} : + []) :: [SqlCDataType] + +{- +#define SQL_C_BINARY SQL_BINARY +#define SQL_C_BIT SQL_BIT +#define SQL_C_BOOKMARK SQL_C_ULONG +#define SQL_C_CHAR SQL_CHAR +#define SQL_C_DATE SQL_DATE +#define SQL_C_DEFAULT 99 +#define SQL_C_DOUBLE SQL_DOUBLE +#define SQL_C_FLOAT SQL_REAL +#define SQL_C_LONG SQL_INTEGER +#define SQL_C_SHORT SQL_SMALLINT +#define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET) +#define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET) +#define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET) +#define SQL_C_TIME SQL_TIME +#define SQL_C_TIMESTAMP SQL_TIMESTAMP +#define SQL_C_TINYINT SQL_TINYINT +#define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) +#define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) +#define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) +-} + +( + sqlParamInput : + sqlParamInputOutput : + sqlParamOutput : + sqlParamDefault : + sqlParamUnknown : + [] ) = + ( + #{const SQL_PARAM_INPUT} : + #{const SQL_PARAM_INPUT_OUTPUT} : + #{const SQL_PARAM_OUTPUT} : + #{const SQL_PARAM_TYPE_DEFAULT} : + #{const SQL_PARAM_TYPE_UNKNOWN} : + [] ) :: [SqlParamDirection] + + +data OdbcException = OdbcException Int String String [OdbcException] + deriving (Typeable) + +instance Show OdbcException where + show (OdbcException i st s _) = "OdbcException " + ++ (show i) ++ " " ++ st ++ " " ++ s + +catchOdbc :: IO a -> (OdbcException -> IO a) -> IO a +catchOdbc = catchDyn + +throwOdbc :: OdbcException -> a +throwOdbc = throwDyn + +-- define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) +sqlSucceeded rc = rc == sqlRcSuccess || rc == sqlRcSuccessWithInfo + +type MyCString = CString +type MyCStringLen = CStringLen +myPeekCStringLen p = peekUTF8StringLen p +myWithCString s = withUTF8String s +myWithCStringLen s = withUTF8StringLen s +--myPeekCStringLen p = peekCStringLen p +--myWithCString s = withCString s +--myWithCStringLen s = withCStringLen s + +getDiagRec :: SqlReturn -> SqlHandleType -> Handle -> SqlSmallInt -> IO [OdbcException] +getDiagRec retcode htype handle row = + allocaBytes 6 $ \cstrState -> do + alloca $ \errorNumPtr -> do + allocaBytes 1025 $ \cstrMsg -> do + alloca $ \msgLenPtr -> do + rc <- sqlGetDiagRec htype handle row cstrState errorNumPtr cstrMsg 1024 msgLenPtr + --putStrLn ("getDiagRec: rc=" ++ show rc) + case () of + _ | rc == sqlRcSuccess -> do + errnum <- peek errorNumPtr + state <- myPeekCStringLen (cstrState, 5) + msglen <- peek msgLenPtr + --putStrLn ("getDiagRec: msglen=" ++ show msglen) + msg <- myPeekCStringLen (cstrMsg, fromIntegral msglen) + --putStrLn ("getDiagRec: msg=" ++ msg) + more <- getDiagRec retcode htype handle (row+1) + return ((OdbcException (fromIntegral errnum) state msg []) : more) + | rc == sqlRcNoData -> return [] + | otherwise -> return [OdbcException (fromIntegral rc) "01000" (showReturnCode retcode) []] + +checkError :: SqlReturn -> SqlHandleType -> Handle -> IO () +checkError rc htype handle = + when (rc /= sqlRcSuccess && rc /= sqlRcSuccessWithInfo) + (do + exs <- getDiagRec rc htype handle 1 + if null exs + then throwOdbc (OdbcException (fromIntegral rc) "01000" + ("No error messages for return code " ++ show rc ++ " (" ++ showReturnCode rc ++ ")") []) + else do + let (OdbcException i st s _) = head exs + throwOdbc (OdbcException i st s (tail exs)) + ) + +allocHdl :: (Storable a) => Handle -> SqlHandleType -> IO a +allocHdl h htype = do + alloca $ \hptr -> do + rc <- sqlAllocHandle htype h (castPtr hptr) + checkError rc htype h + peek hptr + +allocEnv :: IO EnvHandle +allocEnv = allocHdl nullPtr sqlHTypeEnv + +allocConn :: EnvHandle -> IO ConnHandle +allocConn env = allocHdl (castPtr env) sqlHTypeConn + +allocStmt :: ConnHandle -> IO StmtHandle +allocStmt conn = allocHdl (castPtr conn) sqlHTypeStmt + +freeHelper :: SqlHandleType -> Handle -> IO () +freeHelper htype h = do + rc <- sqlFreeHandle htype h + checkError rc htype h + +freeEnv :: EnvHandle -> IO () +freeEnv env = freeHelper sqlHTypeEnv (castPtr env) + +freeConn :: ConnHandle -> IO () +freeConn conn = freeHelper sqlHTypeConn (castPtr conn) + +freeStmt :: StmtHandle -> IO () +freeStmt stmt = freeHelper sqlHTypeStmt (castPtr stmt) + +int2Ptr :: SqlInteger -> Ptr () +int2Ptr i = plusPtr nullPtr (fromIntegral i) + +setOdbcVer :: EnvHandle -> IO () +setOdbcVer env = do + rc <- sqlSetEnvAttr env sqlAttrOdbcVersion (int2Ptr sqlOvOdbc3) 0 + checkError rc sqlHTypeEnv (castPtr env) + +connect :: ConnHandle -> String -> IO String +connect conn connstr = do + myWithCStringLen connstr $ \(cstr, clen) -> do + allocaBytes 1000 $ \outConnStr -> do + alloca $ \ptrOutLen -> do + rc <- sqlDriverConnect conn nullPtr cstr (fromIntegral clen) + outConnStr 1000 ptrOutLen sqlDriverNoPrompt + checkError rc sqlHTypeConn (castPtr conn) + outLen <- peek ptrOutLen + myPeekCStringLen (outConnStr, fromIntegral outLen) + +disconnect :: ConnHandle -> IO () +disconnect conn = do + rc <- sqlDisconnect conn + checkError rc sqlHTypeConn (castPtr conn) + + +prepareStmt :: StmtHandle -> String -> IO () +prepareStmt stmt sqltext = do + myWithCString sqltext $ \cstr -> do + rc <- sqlPrepare stmt cstr sqlNullTermedString + checkError rc sqlHTypeStmt (castPtr stmt) + +executeStmt :: StmtHandle -> IO () +executeStmt stmt = do + rc <- sqlExecute stmt + checkError rc sqlHTypeStmt (castPtr stmt) + +closeCursor :: StmtHandle -> IO () +closeCursor stmt = do + rc <- sqlCloseCursor stmt + checkError rc sqlHTypeStmt (castPtr stmt) + +rowCount :: StmtHandle -> IO Int +rowCount stmt = do + alloca $ \rcptr -> do + rc <- sqlRowCount stmt rcptr + checkError rc sqlHTypeStmt (castPtr stmt) + liftM fromIntegral (peek rcptr) + +-- | Return 'True' if there are more rows, 'False' if end-of-data. +fetch :: StmtHandle -> IO Bool +fetch stmt = do + rc <- sqlFetch stmt + when (rc /= sqlRcNoData) + (checkError rc sqlHTypeStmt (castPtr stmt)) + return (rc /= sqlRcNoData) + +moreResults :: StmtHandle -> IO Bool +moreResults stmt = do + rc <- sqlMoreResults stmt + when (rc /= sqlRcNoData) + (checkError rc sqlHTypeStmt (castPtr stmt)) + return (rc /= sqlRcNoData) + + +commit :: ConnHandle -> IO () +commit conn = do + rc <- sqlEndTran sqlHTypeConn (castPtr conn) sqlTransCommit + checkError rc sqlHTypeConn (castPtr conn) + +rollback :: ConnHandle -> IO () +rollback conn = do + rc <- sqlEndTran sqlHTypeConn (castPtr conn) sqlTransRollback + checkError rc sqlHTypeConn (castPtr conn) + +setAutoCommitOn :: ConnHandle -> IO () +setAutoCommitOn conn = do + rc <- sqlSetConnectAttr conn sqlAttrAutoCommit (int2Ptr sqlAutoCommitOn) 0 + checkError rc sqlHTypeConn (castPtr conn) + +setAutoCommitOff :: ConnHandle -> IO () +setAutoCommitOff conn = do + rc <- sqlSetConnectAttr conn sqlAttrAutoCommit (int2Ptr sqlAutoCommitOff) 0 + checkError rc sqlHTypeConn (castPtr conn) + +setTxnIsolation :: ConnHandle -> SqlInteger -> IO () +setTxnIsolation conn level = do + rc <- sqlSetConnectAttr conn sqlAttrTxnIsolation (int2Ptr level) 0 + checkError rc sqlHTypeConn (castPtr conn) + + +--------------------------------------------------------------------- +-- Get column values with SQLGetData + +getMaybeFromBuffer :: Storable a => Ptr SqlLen -> Ptr a -> (Ptr a -> SqlLen -> IO b) -> IO (Maybe b) +getMaybeFromBuffer szptr bptr action = do + len <- peek szptr + if len < 0 then return Nothing + else action bptr len >>= return . Just + +getDataStorable :: Storable a => StmtHandle -> Int -> SqlDataType -> Int -> (a -> b) -> IO (Maybe b) +getDataStorable stmt pos sqltype buffersize convert = do + allocaBytes buffersize $ \bptr -> do + alloca $ \szptr -> do + rc <- sqlGetData stmt (fromIntegral pos) sqltype (castPtr bptr) 0 szptr + checkError rc sqlHTypeStmt (castPtr stmt) + getMaybeFromBuffer szptr bptr (\buffer len -> peek buffer >>= return . convert ) + +getDataUtcTime :: StmtHandle -> Int -> IO (Maybe UTCTime) +getDataUtcTime stmt pos = do + allocaBytes #{size TIMESTAMP_STRUCT} $ \bptr -> do + alloca $ \szptr -> do + rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeTimestamp (castPtr bptr) 50 szptr + checkError rc sqlHTypeStmt (castPtr stmt) + getMaybeFromBuffer szptr bptr (\buffer len -> readUtcTimeFromMemory buffer >>= return ) + +getDataCStringLen :: StmtHandle -> Int -> IO (Maybe CStringLen) +getDataCStringLen stmt pos = do + alloca $ \szptr -> do + allocaBytes 16 $ \dummyptr -> do + -- Call GetData with 0-sized buffer to get size information. + rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeString (castPtr dummyptr) 0 szptr + when (rc /= sqlRcSuccessWithInfo) + (checkError rc sqlHTypeStmt (castPtr stmt)) + bufSize <- peek szptr + let bufSize' = 1 + if bufSize < 0 then 0 else bufSize + -- Use size information to allocate perfectly-sized buffer. + allocaBytes (fromIntegral bufSize') $ \bptr -> do + rc <- sqlGetData stmt (fromIntegral pos) sqlDTypeString (castPtr bptr) 100000 szptr + checkError rc sqlHTypeStmt (castPtr stmt) + len <- peek szptr + if len < 0 then return Nothing + else return (Just (castPtr bptr, fromIntegral len)) + +getDataUTF8String :: StmtHandle -> Int -> IO (Maybe String) +getDataUTF8String stmt pos = do + mbcstrlen <- getDataCStringLen stmt pos + case mbcstrlen of + Nothing -> return Nothing + Just cstrlen -> peekUTF8StringLen cstrlen >>= return . Just + +getDataCString :: StmtHandle -> Int -> IO (Maybe String) +getDataCString stmt pos = do + mbcstrlen <- getDataCStringLen stmt pos + case mbcstrlen of + Nothing -> return Nothing + Just cstrlen -> peekCStringLen cstrlen >>= return . Just + +{- from sqltypes.h. Struct size depends on size of SmallInt etc, +but is 16 bytes on a 32-bit platform. 32 bytes on 64-bit? +typedef struct tagTIMESTAMP_STRUCT { + SQLSMALLINT year; + SQLUSMALLINT month; + SQLUSMALLINT day; + SQLUSMALLINT hour; + SQLUSMALLINT minute; + SQLUSMALLINT second; + SQLUINTEGER fraction; +} TIMESTAMP_STRUCT; +-} + +peekSmallInt :: Ptr a -> Int -> IO SqlSmallInt +peekSmallInt buffer offset = peekByteOff buffer offset +peekUSmallInt :: Ptr a -> Int -> IO SqlUSmallInt +peekUSmallInt buffer offset = peekByteOff buffer offset +peekUInteger :: Ptr a -> Int -> IO SqlUInteger +peekUInteger buffer offset = peekByteOff buffer offset + +-- We have to give the Ptr a concrete type, to keep the type-checker +-- happy, but it can be anything. It has to be a Storable type, though. + +readUtcTimeFromMemory :: Ptr Word8 -> IO UTCTime +readUtcTimeFromMemory buffer = do + year <- peekSmallInt buffer #{offset TIMESTAMP_STRUCT, year} + month <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, month} + day <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, day} + hour <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, hour} + minute <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, minute} + second <- peekUSmallInt buffer #{offset TIMESTAMP_STRUCT, second} + -- Fraction ranges from 0 - 999,999,999, + frac <- peekUInteger buffer #{offset TIMESTAMP_STRUCT, fraction} + let secs :: Double; secs = fromIntegral second + (fromIntegral frac / 1000000000.0) + return (mkUTCTime (fromIntegral year) month day hour minute second) + +--------------------------------------------------------------------- +-- Return-set column binding. +-- Apparently this is faster than SQLGetData for larger result-sets, +-- because the output buffers do not need to be rebound with +-- every call. +-- Dunno how much difference this'll make in practice. Suck 'n' see. + +bindColumnBuffer :: StmtHandle -> Int -> SqlDataType -> SqlLen -> IO BindBuffer +bindColumnBuffer stmt pos dtype size = do + buffer <- createEmptyBuffer (fromIntegral size) + withForeignPtr (bindBufPtr buffer) $ \bptr -> do + withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do + rc <- sqlBindCol stmt (fromIntegral pos) dtype bptr size szptr + checkError rc sqlHTypeStmt (castPtr stmt) + return buffer + +createEmptyBuffer :: SqlLen -> IO BindBuffer +createEmptyBuffer size = do + szfptr <- mallocForeignPtr + bfptr <- mallocForeignPtrBytes (fromIntegral size) + return (BindBuffer bfptr szfptr size) + + +testForNull :: BindBuffer -> (Ptr Buffer -> SqlLen -> IO a) -> IO (Maybe a) +testForNull buffer action = do + withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do + len <- peek szptr + -- sqlNullData = -1, so anthing less than zero could + -- be treated as null. + if len < 0 then return Nothing + else withForeignPtr (bindBufPtr buffer) $ \bptr -> + action bptr len >>= return . Just + +getStorableFromBuffer :: Storable a => BindBuffer -> IO (Maybe a) +getStorableFromBuffer buffer = + testForNull buffer (\bptr _ -> peek (castPtr bptr)) + +getCAStringFromBuffer :: BindBuffer -> IO (Maybe String) +getCAStringFromBuffer buffer = + testForNull buffer (\ptr len -> peekCAStringLen (castPtr ptr, fromIntegral len)) + +getCWStringFromBuffer :: BindBuffer -> IO (Maybe String) +getCWStringFromBuffer buffer = + testForNull buffer (\ptr len -> peekCWStringLen (castPtr ptr, fromIntegral len)) + +getUTF8StringFromBuffer :: BindBuffer -> IO (Maybe String) +getUTF8StringFromBuffer buffer = + testForNull buffer (\ptr len -> peekUTF8StringLen (castPtr ptr, fromIntegral len)) + +getUtcTimeFromBuffer :: BindBuffer -> IO (Maybe UTCTime) +getUtcTimeFromBuffer bindbuffer = do + testForNull bindbuffer $ \buffer _ -> do + readUtcTimeFromMemory (castPtr buffer) + + +--------------------------------------------------------------------- +-- Parameter binding + +createBufferForStorable :: Storable a => Maybe a -> IO BindBuffer +createBufferForStorable Nothing = + let zero :: Int; zero = 0; in createBufferHelper zero (-1) +createBufferForStorable (Just val) = createBufferHelper val (fromIntegral (sizeOf val)) + +createBufferHelper :: Storable a => a -> SqlLen -> IO BindBuffer +createBufferHelper val size = do + szfptr <- mallocForeignPtr + withForeignPtr szfptr (\szptr -> poke szptr size) + bfptr <- mallocForeignPtr + withForeignPtr bfptr (\bptr -> poke bptr val) + return (BindBuffer (castForeignPtr bfptr) szfptr (fromIntegral size)) + +wrapSizedBuffer :: Ptr a -> SqlLen -> IO BindBuffer +wrapSizedBuffer valptr size = do + szfptr <- mallocForeignPtr + withForeignPtr szfptr (\szptr -> poke szptr size) + bfptr <- newForeignPtr finalizerFree valptr + return (BindBuffer (castForeignPtr bfptr) szfptr (fromIntegral size)) + +bindParam :: + StmtHandle + -> Int + -> SqlParamDirection + -> SqlCDataType + -> SqlDataType + -> SqlULen + -> SqlSmallInt + -> BindBuffer + -> IO () +bindParam stmt pos direction ctype sqltype precision scale buffer = + withForeignPtr (bindBufPtr buffer) $ \bptr -> do + withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do + size <- peek szptr + rc <- sqlBindParameter stmt (fromIntegral pos) direction ctype sqltype precision scale bptr size szptr + checkError rc sqlHTypeStmt (castPtr stmt) + +-- sqlParamInput +bindNull :: StmtHandle -> Int -> SqlParamDirection -> SqlCDataType -> SqlDataType -> IO BindBuffer +bindNull stmt pos direction ctype dtype = do + let val :: Maybe Int; val = Nothing + buffer <- createBufferForStorable val + bindParam stmt pos direction ctype dtype 0 0 buffer + return buffer + +bindParamCStringLen :: StmtHandle -> Int -> SqlParamDirection -> Maybe CStringLen -> IO BindBuffer +bindParamCStringLen stmt pos direction Nothing = + bindNull stmt pos direction sqlCTypeString sqlDTypeString +bindParamCStringLen stmt pos direction (Just (cstr, clen)) = do + buffer <- wrapSizedBuffer cstr (fromIntegral clen) + bindParam stmt pos direction sqlCTypeString sqlDTypeString (fromIntegral clen) 0 buffer + return buffer + +bindEncodedString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> (String -> ((Ptr a, Int) -> IO BindBuffer) -> IO BindBuffer) -> IO BindBuffer +bindEncodedString stmt pos direction Nothing withEncoder = + bindNull stmt pos direction sqlCTypeString sqlDTypeString +bindEncodedString stmt pos direction (Just s) withEncoder = + withEncoder s (\(cs, cl) -> bindParamCStringLen stmt pos direction (Just (castPtr cs, cl))) + +bindParamUTF8String :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer +bindParamUTF8String stmt pos direction val = + bindEncodedString stmt pos direction val withUTF8StringLen + +bindParamCAString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer +bindParamCAString stmt pos direction val = + bindEncodedString stmt pos direction val withCAStringLen + +bindParamCWString :: StmtHandle -> Int -> SqlParamDirection -> Maybe String -> IO BindBuffer +bindParamCWString stmt pos direction val = + bindEncodedString stmt pos direction val withCWStringLen + +pokeSmallInt :: Ptr a -> Int -> SqlSmallInt -> IO () +pokeSmallInt buffer offset val = pokeByteOff buffer offset val +pokeUSmallInt :: Ptr a -> Int -> SqlUSmallInt -> IO () +pokeUSmallInt buffer offset val = pokeByteOff buffer offset val +pokeUInteger :: Ptr a -> Int -> SqlUInteger -> IO () +pokeUInteger buffer offset val = pokeByteOff buffer offset val + +writeUTCTimeToMemory :: Ptr Word8 -> UTCTime -> IO () +writeUTCTimeToMemory buffer utc = do + let + (LocalTime ltday time) = utcToLocalTime (hoursToTimeZone 0) utc + (TimeOfDay hour minute second) = time + (year, month, day) = toGregorian ltday + pokeSmallInt buffer #{offset TIMESTAMP_STRUCT, year} (fromIntegral year) + pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, month} (fromIntegral month) + pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, day} (fromIntegral day) + pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, hour} (fromIntegral hour) + pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, minute} (fromIntegral minute) + -- what do we do with fraction? What sort of fraction is it? + -- apparently can range from 0 - 999,999,999, + -- but MS SQL Server only handles milliseconds (0 - 999) i.e. precision 3 + let (secs, frac) = properFraction second + let fraction :: SqlUInteger; fraction = round (frac * 1000000000.0) + pokeUSmallInt buffer #{offset TIMESTAMP_STRUCT, second} secs + pokeUInteger buffer #{offset TIMESTAMP_STRUCT, fraction} fraction + +-- writeUTCTimeToMemory and makeUtcTimeBuffer don't work with MS SQL Server; +-- it always returns 22008 "Datetime field overflow". +-- They work with PostgreSQL and Oracle ODBC drivers. +-- So I'll leave the code here, in case anyone is desperate +-- to marshal via TIMESTAMP_STRUCT, rather than strings. + +makeUtcTimeBuffer :: UTCTime -> IO BindBuffer +makeUtcTimeBuffer utc = do + mem <- mallocBytes #{size TIMESTAMP_STRUCT} + writeUTCTimeToMemory (castPtr mem) utc + wrapSizedBuffer mem #{size TIMESTAMP_STRUCT} + +makeUtcTimeStringBuffer :: UTCTime -> IO BindBuffer +makeUtcTimeStringBuffer utc = do + mem <- mallocBytes 40 + let s = utcTimeToOdbcDatetime utc + withCStringLen s $ \(cstr, clen) -> do + copyBytes mem cstr (fromIntegral clen) + pokeByteOff mem (fromIntegral clen) (0 :: Word8) + wrapSizedBuffer mem (fromIntegral clen) + +bindParamUtcTime :: StmtHandle -> Int -> SqlParamDirection -> Maybe UTCTime -> IO BindBuffer +bindParamUtcTime stmt pos direction Nothing = do + bindNull stmt pos direction sqlCTypeTimestamp sqlDTypeTimestamp +bindParamUtcTime stmt pos direction (Just utc) = do + -- For TimeStamp: + -- Size/Length should be 16 bytes. + -- Precision should be 8 (or 16?). + -- Scale is the number of digits in the fraction component (SQL Server only allows 0-3). + -- We're not using the TIMESTAMP_STRUCT to marshal any more. + --buffer <- makeUtcTimeBuffer utc + --bindParam stmt pos direction sqlCTypeTimestamp sqlDTypeTimestamp #{size TIMESTAMP_STRUCT} 0 buffer + -- + -- We have to pass in a String, rather than a TIMESTAMP_STRUCT, + -- and let the ODBC driver do the conversion. + -- I cannot get TIMESTAMP_STRUCT to work with MS SQL Server; + -- it always returns 22008 "Datetime field overflow". + buffer <- makeUtcTimeStringBuffer utc + withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do + size <- peek szptr + -- 23 is the largest precision value allowed by MS SQL Server. + -- That gives us "yyyy-mm-dd hh:mm:ss.fff" + bindParam stmt pos direction sqlCTypeString sqlDTypeTimestamp 23 0 buffer + return buffer + + +--------------------------------------------------------------------- +-- Binding with class... + +sizeOfMaybe :: forall a. Storable a => Maybe a -> Int +sizeOfMaybe _ = sizeOf ( undefined :: a ) +-- H98 stylee... +--sizeOfMaybe v@Nothing = sizeOfMaybe (asTypeOf (Just undefined) v) +--sizeOfMaybe (Just v) = sizeOf v + +newtype OutParam a = OutParam a +newtype InOutParam a = InOutParam a + +{- +Separate out the type different types of binding: parameter and column. + +Both types use the same BindBuffer, but bind parameters +can send and receive values from the buffer, whereas +column binds only receive values. +This distinction will be handled by having a set of +instances for OdbcBindBuffer that are of the form (Maybe a), +where a is one of the normal database types e.g. Int, Double, +String, UTCTime. +The instances for OdbcBindParam will include the (Maybe a) set, +and also (OutParam (Maybe a)), and (InOutParam (Maybe a)), +to indicate Out and In/Out paramaters. + +When we do a column buffer bind, we require a dummy value +of the column data type, so that we know which instance to use. +-} + +class OdbcBindBuffer a where + bindColBuffer + :: StmtHandle -- ^ stmt handle + -> Int -- ^ column position (1-indexed) + -> Int -- ^ size of result buffer (ignored when it can be inferred from type of a) + -> a -- ^ dummy value of the appropriate type (just to ensure we get the right class instance) + -> IO BindBuffer -- ^ returns a 'BindBuffer' object + getFromBuffer :: BindBuffer -> IO a + getData :: StmtHandle -> Int -> IO a + +instance OdbcBindBuffer (Maybe Int) where + bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeInt (fromIntegral (sizeOfMaybe val)) + getFromBuffer buffer = getStorableFromBuffer buffer + getData stmt pos = getDataStorable stmt pos sqlDTypeInt (sizeOf cint) convert + where convert :: CInt -> Int; convert = fromIntegral + cint :: CInt; cint = 0 + +instance OdbcBindBuffer (Maybe Double) where + bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeDouble (fromIntegral (sizeOfMaybe val)) + getFromBuffer buffer = getStorableFromBuffer buffer + getData stmt pos = getDataStorable stmt pos sqlDTypeDouble (sizeOf cdbl) convert + where convert :: CDouble -> Double; convert = realToFrac + cdbl :: CDouble; cdbl = 0 + +instance OdbcBindBuffer (Maybe String) where + bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeString (fromIntegral size) + getFromBuffer buffer = getUTF8StringFromBuffer buffer + getData stmt pos = getDataUTF8String stmt pos + +instance OdbcBindBuffer (Maybe UTCTime) where + bindColBuffer stmt pos size val = bindColumnBuffer stmt pos sqlDTypeTimestamp #{size TIMESTAMP_STRUCT} + getFromBuffer buffer = getUtcTimeFromBuffer buffer + getData stmt pos = getDataUtcTime stmt pos + + +class OdbcBindParam a where + bindParamBuffer + :: StmtHandle -- ^ stmt handle + -> Int -- ^ parameter position (1-indexed) + -> a -- ^ value to write to buffer + -> IO BindBuffer -- ^ returns a 'BindBuffer' object + +instance OdbcBindParam (Maybe Int) where + bindParamBuffer stmt pos val = do + buffer <- createBufferForStorable val + bindParam stmt pos sqlParamInput sqlCTypeInt sqlDTypeInt 30 0 buffer + return buffer + +instance OdbcBindParam (Maybe Double) where + bindParamBuffer stmt pos val = do + buffer <- createBufferForStorable val + bindParam stmt pos sqlParamInput sqlCTypeDouble sqlDTypeDouble 50 50 buffer + return buffer + +instance OdbcBindParam (Maybe String) where + bindParamBuffer stmt pos val = bindParamUTF8String stmt pos sqlParamInput val + +instance OdbcBindParam (Maybe UTCTime) where + bindParamBuffer stmt pos val = bindParamUtcTime stmt pos sqlParamInput val + + +--------------------------------------------------------------------- +-- FFI + +-- From sql.h: +-- SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); +foreign import #{CALLCONV} unsafe "sql.h SQLAllocHandle" sqlAllocHandle :: + SqlHandleType -> Handle -> Ptr Handle -> IO SqlReturn + +-- SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT,SQLHANDLE); +foreign import #{CALLCONV} unsafe "sql.h SQLFreeHandle" sqlFreeHandle :: + SqlSmallInt -> Handle -> IO SqlReturn + +-- SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); +foreign import #{CALLCONV} unsafe "sql.h SQLGetDiagRec" sqlGetDiagRec :: + SqlHandleType -- ^ enum: which handle type is the next parameter? + -> Handle -- ^ generic handle ptr + -> SqlSmallInt -- ^ row (or message) number + -> MyCString -- ^ OUT: state + -> Ptr SqlInteger -- ^ OUT: error number + -> MyCString -- ^ OUT: error message + -> SqlSmallInt -- ^ IN: message buffer size + -> Ptr SqlSmallInt -- ^ OUT: message length + -> IO SqlReturn + +-- SQLRETURN SQL_API SQLDriverConnect(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT); +foreign import #{CALLCONV} unsafe "sql.h SQLDriverConnect" sqlDriverConnect :: + ConnHandle + -> WindowHandle -- ^ just pass nullPtr + -> MyCString -- ^ connection string + -> SqlSmallInt -- ^ connection string size + -> MyCString -- ^ OUT: buffer for normalised connection string + -> SqlSmallInt -- ^ buffer size + -> Ptr SqlSmallInt -- ^ OUT: length of returned string + -> SqlUSmallInt -- ^ enum: should driver prompt user for missing info? + -> IO SqlReturn + +-- SQLRETURN SQL_API SQLDisconnect(SQLHDBC); +foreign import #{CALLCONV} unsafe "sql.h SQLDisconnect" sqlDisconnect :: + ConnHandle -> IO SqlReturn + +-- SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER); +foreign import #{CALLCONV} unsafe "sql.h SQLSetEnvAttr" sqlSetEnvAttr :: + EnvHandle -- ^ Env Handle + -> SqlInteger -- ^ Attribute (enumeration) + -> Ptr () -- ^ value (cast to void*) + -> SqlInteger -- ^ ? - set to 0 + -> IO SqlReturn + +-- SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER); +foreign import #{CALLCONV} unsafe "sql.h SQLSetConnectAttr" sqlSetConnectAttr :: + ConnHandle -- ^ Connection Handle + -> SqlInteger -- ^ Attribute (enumeration) + -> Ptr () -- ^ value (cast to void*) + -> SqlInteger -- ^ ? - set to 0 + -> IO SqlReturn + +-- SQLRETURN SQL_API SQLPrepare(SQLHSTMT,SQLCHAR*,SQLINTEGER); +foreign import #{CALLCONV} unsafe "sql.h SQLPrepare" sqlPrepare :: + StmtHandle -> MyCString -> SqlInteger -> IO SqlReturn + +-- SQLRETURN SQL_API SQLExecute(SQLHSTMT); +foreign import #{CALLCONV} unsafe "sql.h SQLExecute" sqlExecute :: + StmtHandle -> IO SqlReturn + +-- SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT); +foreign import #{CALLCONV} unsafe "sql.h SQLCloseCursor" sqlCloseCursor :: + StmtHandle -> IO SqlReturn + +-- SQLRETURN SQL_API SQLRowCount(SQLHSTMT,SQLLEN*); +foreign import #{CALLCONV} unsafe "sql.h SQLRowCount" sqlRowCount :: + StmtHandle -> Ptr SqlLen -> IO SqlReturn + +-- SQLRETURN SQL_API SQLGetData(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); +foreign import #{CALLCONV} unsafe "sql.h SQLGetData" sqlGetData :: + StmtHandle + -> SqlUSmallInt -- ^ column position, 1-indexed + -> SqlDataType -- ^ SQL data type: string, int, long, date, etc + -> Ptr Buffer -- ^ output buffer + -> SqlLen -- ^ output buffer size + -> Ptr SqlLen -- ^ output data size, or -1 (SQL_NULL_DATA) for null + -> IO SqlReturn + +-- SQLRETURN SQL_API SQLBindCol(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); +foreign import #{CALLCONV} unsafe "sql.h SQLBindCol" sqlBindCol :: + StmtHandle + -> SqlUSmallInt -- ^ column position, 1-indexed + -> SqlDataType -- ^ SQL data type: string, int, long, date, etc + -> Ptr Buffer -- ^ output buffer + -> SqlLen -- ^ output buffer size + -> Ptr SqlLen -- ^ output data size, or -1 (SQL_NULL_DATA) for null + -> IO SqlReturn + +-- SQLRETURN SQL_API SQLFetch(SQLHSTMT); +foreign import #{CALLCONV} unsafe "sql.h SQLFetch" sqlFetch :: + StmtHandle -> IO SqlReturn + +-- SQLRETURN SQL_API SQLBindParameter(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); +foreign import #{CALLCONV} unsafe "sql.h SQLBindParameter" sqlBindParameter :: + StmtHandle + -> SqlUSmallInt -- ^ position, 1-indexed + -> SqlParamDirection -- ^ direction: IN, OUT + -> SqlCDataType -- ^ C data type: char, int, long, float, etc + -> SqlDataType -- ^ SQL data type: string, int, long, date, etc + -> SqlULen -- ^ col size (precision) + -> SqlSmallInt -- ^ decimal digits (scale) + -> Ptr Buffer -- ^ input+output buffer + -> SqlLen -- ^ buffer size + -> Ptr SqlLen -- ^ input+output data size, or -1 (SQL_NULL_DATA) for null + -> IO SqlReturn + +-- SQLRETURN SQL_API SQLMoreResults(SQLHSTMT); +foreign import #{CALLCONV} unsafe "sql.h SQLMoreResults" sqlMoreResults :: + StmtHandle -> IO SqlReturn + +-- SQLRETURN SQL_API SQLEndTran(SQLSMALLINT,SQLHANDLE,SQLSMALLINT); +foreign import #{CALLCONV} unsafe "sql.h SQLEndTran" sqlEndTran :: + SqlSmallInt -> Handle -> SqlSmallInt -> IO SqlReturn
+ Database/ODBC/Test/Enumerator.lhs view
@@ -0,0 +1,155 @@+ +| +Module : Database.ODBC.Test.Enumerator +Copyright : (c) 2007 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + + +> module Database.ODBC.Test.Enumerator (runTest) where + +> import qualified Database.ODBC.Test.OdbcFunctions as Low +> import Database.ODBC.Enumerator +> import Database.Test.Performance as Perf +> import Database.Test.Enumerator +> import Database.Util +> import Control.Monad (when) +> import Control.Monad.Trans (liftIO) +> import Control.Exception (throwDyn) +> import Test.MiniUnit + + +> runTest :: Perf.ShouldRunTests -> [String] -> IO () +> runTest runPerf args = do +> let (dsn:_) = args +> Low.runTest args +> flip catchDB basicDBExceptionReporter $ do +> (r, conn1) <- withContinuedSession (connect dsn) (testBody runPerf) +> withSession conn1 testPartTwo + +> testBody :: Perf.ShouldRunTests -> DBM mark Session () +> testBody runPerf = do +> runFixture ODBCFunctions +> when (runPerf == Perf.RunTests) runPerformanceTests + +> testPartTwo :: DBM mark Session () +> testPartTwo = do +> makeFixture execDrop execDDL_ +> destroyFixture execDDL_ + +> runFixture :: DBLiteralValue a => a -> DBM mark Session () +> runFixture fns = do +> makeFixture execDrop execDDL_ +> runTestTT "ODBC tests" (map (runOneTest fns) testList) +> destroyFixture execDDL_ + +> runOneTest fns t = catchDB (t fns) (reportRethrowMsg "runOneTest ") + +> runPerformanceTests :: DBM mark Session () +> runPerformanceTests = do +> makeFixture execDrop execDDL_ +> beginTransaction RepeatableRead +> runTestTT "ODBC performance tests" (map (flip catchDB reportRethrow) +> [ timedSelect (prefetch 1000 sqlRows2Power20 []) 35 (2^20) +> , timedSelect (prefetch 1 sqlRows2Power17 []) 4 (2^17) +> , timedSelect (prefetch 1000 sqlRows2Power17 []) 4 (2^17) +> , timedCursor (prefetch 1 sqlRows2Power17 []) 4 (2^17) +> , timedCursor (prefetch 1000 sqlRows2Power17 []) 4 (2^17) +> ] +> ) +> commit +> destroyFixture execDDL_ + + +----------------------------------------------------------- + +> selectNoRows _ = selectTest sqlNoRows iterNoRows expectNoRows + +> selectTerminatesEarly _ = selectTest sqlTermEarly iterTermEarly expectTermEarly + +> selectFloatsAndInts fns = selectTest (sqlFloatsAndInts fns) iterFloatsAndInts expectFloatsAndInts + +> selectNullString _ = selectTest sqlNullString iterNullString expectNullString + +> selectEmptyString _ = selectTest sqlEmptyString iterEmptyString expectEmptyString + +> selectUnhandledNull _ = catchDB ( do +> selectTest sqlUnhandledNull iterUnhandledNull expectUnhandledNull +> assertFailure sqlUnhandledNull +> ) (\e -> return () ) + + + +> selectNullDate dateFn = selectTest (sqlNullDate dateFn) iterNullDate expectNullDate + +> selectCursor fns = actionCursor (sqlCursor fns) +> selectExhaustCursor fns = actionExhaustCursor (sqlCursor fns) + +> selectBindString _ = actionBindString +> (prepareQuery (sql sqlBindString)) +> [bindP "a2", bindP "b1"] + +> selectBindInt _ = actionBindInt +> (prepareQuery (sql sqlBindInt)) +> [bindP (1::Int), bindP (2::Int)] + + +> selectBindIntDoubleString _ = actionBindIntDoubleString +> (prefetch 1 sqlBindIntDoubleString [bindP (1::Int), bindP (2.2::Double), bindP "row 1", bindP (3::Int), bindP (4.4::Double), bindP "row 2"]) + +> selectBindDate _ = actionBindDate +> (prefetch 1 sqlBindDate (map bindP expectBindDate)) + +> selectBindBoundaryDates _ = actionBindBoundaryDatesLocal +> (prefetch 1 sqlBindBoundaryDates (map bindP expectBoundaryDatesLocal)) + +> expectBoundaryDatesLocal = +> -- 1753 seems to be about the earliest year MS SQL Server supports. +> [ int64ToUTCTime 17530101000000 +> , int64ToUTCTime 20010102000000 +> , int64ToUTCTime 20010103000000 +> , int64ToUTCTime 99991231000000 +> ] +> actionBindBoundaryDatesLocal stmt = do +> withTransaction Serialisable $ do +> actual <- doQuery stmt iterBindDate [] +> assertEqual sqlBindBoundaryDates expectBoundaryDatesLocal actual + + +> selectRebindStmt _ = actionRebind (prepareQuery (sql sqlRebind)) +> [bindP (1::Int)] [bindP (2::Int)] + +> boundStmtDML _ = actionBoundStmtDML (prepareCommand (sql sqlBoundStmtDML)) +> boundStmtDML2 _ = do +> -- With MS SQL Server cannot use withTransaction with rollback/commit; +> -- if you explicitly end the transaction, then when withTransaction +> -- attempts to end it (with a commit, in the success case) then we +> -- get a "logic error". +> -- This differs from PostgreSQL and Oracle, who don't seem to care if +> -- you commit or rollback too many times. +> beginTransaction ReadCommitted +> count <- execDML (cmdbind sqlBoundStmtDML [bindP (100::Int), bindP "100"]) +> rollback +> assertEqual sqlBoundStmtDML 1 count + +> polymorphicFetchTest _ = actionPolymorphicFetch +> (prefetch 1 sqlPolymorphicFetch [bindP expectPolymorphicFetch]) + +> polymorphicFetchTestNull _ = actionPolymorphicFetchNull +> (prefetch 1 sqlPolymorphicFetchNull []) + +> exceptionRollback _ = actionExceptionRollback sqlInsertTest4 sqlExceptionRollback + + +> testList :: DBLiteralValue a => [a -> DBM mark Session ()] +> testList = +> [ selectNoRows, selectTerminatesEarly, selectFloatsAndInts +> , selectNullString, selectEmptyString, selectUnhandledNull +> , selectCursor, selectExhaustCursor +> , selectBindString, selectBindInt, selectBindIntDoubleString +> , selectBindDate, selectBindBoundaryDates, selectRebindStmt +> , boundStmtDML, boundStmtDML2 +> , polymorphicFetchTest, polymorphicFetchTestNull, exceptionRollback +> ]
+ Database/ODBC/Test/OdbcFunctions.lhs view
@@ -0,0 +1,359 @@+ +| +Module : Database.ODBC.Test.OdbcFunctions +Copyright : (c) 2007 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + + + +> module Database.ODBC.Test.OdbcFunctions where + +> import Database.ODBC.OdbcFunctions +> import Control.Exception (finally) +> import Data.Char +> import Data.List +> import Data.Time +> import Data.Word (Word8) +> import Database.Util +> import Test.MiniUnit +> import Foreign.ForeignPtr (withForeignPtr) +> import Foreign.Ptr (castPtr) +> import Foreign.Storable (peek) +> import Foreign.Marshal.Array (peekArray0, peekArray) +> import Numeric (showHex) + + +> ignoreError action = +> catchOdbc action (\e -> return undefined) + +> printIgnoreError action = catchOdbc action +> (\e -> do +> putStrLn (show e) +> return undefined +> ) + +> printPropagateError action = catchOdbc action +> (\e -> do +> putStrLn (show e) +> throwOdbc e +> return undefined +> ) + +> testCreateEnv = do +> env <- allocEnv +> freeEnv env + +> testCreateConn = do +> env <- allocEnv +> setOdbcVer env +> conn <- allocConn env +> freeConn conn +> freeEnv env + +> testConnect connstr = do +> env <- allocEnv +> setOdbcVer env +> conn <- allocConn env +> connstr <- connect conn connstr +> disconnect conn +> freeConn conn +> freeEnv env + +> createConn connstr = do +> env <- allocEnv +> setOdbcVer env +> conn <- allocConn env +> connstr <- connect conn connstr +> return (env, conn) + +> closeConn (env, conn) = do +> disconnect conn +> freeConn conn +> freeEnv env + + +> createDual conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "create table tdual (dummy varchar(1) primary key)" +> executeStmt stmt +> prepareStmt stmt "insert into tdual values ('X')" +> executeStmt stmt +> freeStmt stmt + +> dropDual conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "drop table tdual" +> executeStmt stmt +> freeStmt stmt + + +> testCreateStmt conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "select 'x' from tdual" +> executeStmt stmt +> freeStmt stmt + +> testFetchString conn = do +> stmt <- allocStmt conn +> let string1 = "abc" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] +> let string2 = "xyz" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] +> prepareStmt stmt ("select '" ++ string1 +> ++ "' from tdual union select '" ++ string2 ++ "' from tdual order by 1") +> executeStmt stmt +> more <- fetch stmt +> s <- getDataUTF8String stmt 1 +> assertEqual "testFetchString" (Just string1) s +> more <- fetch stmt +> s <- getDataUTF8String stmt 1 +> assertEqual "testFetchString" (Just string2) s +> more <- fetch stmt +> assertBool "testFetchString: EOD" (not more) +> freeStmt stmt + +> testFetchStringWithBuffer conn = do +> stmt <- allocStmt conn +> let string1 = "abc" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] +> let string2 = "xyz" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] +> prepareStmt stmt ("select '" ++ string1 +> ++ "' from tdual union select '" ++ string2 ++ "' from tdual order by 1") +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 100 (Just "") +> more <- fetch stmt +> s <- getUTF8StringFromBuffer buffer +> assertEqual "testFetchStringWithBuffer" (Just string1) s +> more <- fetch stmt +> s <- getUTF8StringFromBuffer buffer +> assertEqual "testFetchStringWithBuffer" (Just string2) s +> more <- fetch stmt +> assertBool "testFetchStringWithBuffer: EOD" (not more) +> freeStmt stmt + +> testFetchInt conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "select 101 from tdual" +> executeStmt stmt +> more <- fetch stmt +> s <- getData stmt 1 +> let expect :: Int; expect = 101 +> assertEqual "testFetchInt" (Just expect) s +> more <- fetch stmt +> assertBool "testFetchInt: EOD" (not more) +> freeStmt stmt + +> testFetchIntWithBuffer conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "select 101 from tdual" +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 0 (Just (0::Int)) +> more <- fetch stmt +> s <- getFromBuffer buffer +> let expect :: Int; expect = 101 +> assertEqual "testFetchInt" (Just expect) s +> more <- fetch stmt +> assertBool "testFetchInt: EOD" (not more) +> freeStmt stmt + +> testFetchDouble conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "select 123.456789 from tdual" +> executeStmt stmt +> --buffer <- bindColBuffer stmt 1 sqlDTypeDouble 16 +> more <- fetch stmt +> --s <- getDoubleFromBuffer buffer +> s <- getData stmt 1 +> let expect :: Double; expect = 123.456789 +> assertEqual "testFetchDouble" (Just expect) s +> more <- fetch stmt +> assertBool "testFetchDouble: EOD" (not more) +> freeStmt stmt + +> testFetchDatetime conn = do +> stmt <- allocStmt conn +> flip finally (freeStmt stmt) ( do +> -- There is no common SQL standard for datetime literal text. +> -- Well, there is (timestamp), but MS SQL Server doesn't support it. Pah. +> prepareStmt stmt "select cast ('1916-10-01 02:25:21' as timestamp) from tdual" +> --prepareStmt stmt "select cast ('1916-10-01 02:25:21' as datetime) from tdual" +> executeStmt stmt +> let expect :: UTCTime; expect = mkUTCTime 1916 10 1 2 25 21 +> buffer <- bindColBuffer stmt 1 0 (Just expect) +> more <- fetch stmt +> t <- getUtcTimeFromBuffer buffer +> --t <- getDataUtcTime stmt 1 +> assertEqual "testFetchDatetime" (Just expect) t +> more <- fetch stmt +> assertBool "testFetchDatetime: EOD" (not more) +> ) + + +> testBindInt conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "select ? from tdual" +> bindParamBuffer stmt 1 (Just (101::Int)) +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 0 (Just (0::Int)) +> more <- fetch stmt +> s <- getFromBuffer buffer +> let expect :: Int; expect = 101 +> assertEqual "testFetchInt" (Just expect) s +> more <- fetch stmt +> assertBool "testFetchInt: EOD" (not more) +> freeStmt stmt + +> testBindString conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "select ? from tdual" +> let expect = "abc" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] +> bindParamBuffer stmt 1 (Just expect) +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 1000 (Just expect) +> more <- fetch stmt +> s <- getUTF8StringFromBuffer buffer +> assertEqual "testBindString (PostgreSQL fails this one)" (Just expect) s +> more <- fetch stmt +> assertBool "testBindString: EOD" (not more) +> freeStmt stmt + +> printBufferContents buffer = do +> withForeignPtr (bindBufPtr buffer) $ \bptr -> do +> withForeignPtr (bindBufSzPtr buffer) $ \szptr -> do +> sz <- peek szptr +> putStrLn ("printBufferContents: sz = " ++ show sz) +> l <- peekArray (fromIntegral sz) (castPtr bptr) +> let toHex :: Word8 -> String; toHex i = showHex i "" +> let h :: [String]; h = map toHex l +> putStrLn (concat (intersperse " " h)) + +> testUTF8 conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "drop table t_utf8" +> ignoreError (executeStmt stmt) +> prepareStmt stmt "create table t_utf8(s varchar(50))" +> executeStmt stmt +> let expect = "abc" ++ map chr [0x000080, 0x0007FF, 0x00FFFF, 0x10FFFF] +> prepareStmt stmt ("insert into t_utf8 values ( '" ++ expect ++ "' )") +> executeStmt stmt +> prepareStmt stmt "select s from t_utf8" +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 100 (Just expect) +> more <- fetch stmt +> s <- getUTF8StringFromBuffer buffer +> assertEqual "testUTF8" (Just expect) s +> freeStmt stmt + +> testBindUTCTime conn = do +> stmt <- allocStmt conn +> flip finally (freeStmt stmt) ( do +> prepareStmt stmt "select ? from tdual" +> let expect :: UTCTime; expect = mkUTCTime 1916 10 1 2 25 21 +> bindbuf <- bindParamBuffer stmt 1 (Just expect) +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 undefined (Just expect) +> more <- fetch stmt +> t <- getUtcTimeFromBuffer buffer +> assertEqual "testBindUTCTime" (Just expect) t +> more <- fetch stmt +> assertBool "testBindUTCTime: EOD" (not more) +> ) + + +> testBindUTCTimeBoundary conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "select ?, ? from tdual" +> -- 1753 seems to be about the earliest year MS SQL Server supports. +> let expect1 :: UTCTime; expect1 = mkUTCTime 1753 1 1 0 0 0 +> let input1 = expect1 +> let expect2 :: UTCTime; expect2 = mkUTCTime 9999 10 1 2 25 21 +> let input2 = expect2 +> bindParamBuffer stmt 1 (Just input1) +> bindParamBuffer stmt 2 (Just input2) +> executeStmt stmt +> buffer1 <- bindColBuffer stmt 1 32 (Just expect1) +> buffer2 <- bindColBuffer stmt 2 32 (Just expect1) +> more <- fetch stmt +> t1 <- getUtcTimeFromBuffer buffer1 +> t2 <- getUtcTimeFromBuffer buffer2 +> assertEqual "testBindUTCTimeBoundary1" (Just expect1) t1 +> assertEqual "testBindUTCTimeBoundary2" (Just expect2) t2 +> more <- fetch stmt +> assertBool "testBindUTCTimeBoundary: EOD" (not more) +> freeStmt stmt + +> testRebind conn = do +> stmt <- allocStmt conn +> prepareStmt stmt "select ? from tdual" +> -- +> let expect = "abc" +> bindParamBuffer stmt 1 (Just expect) +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 100 (Just "") +> more <- fetch stmt +> s <- getUTF8StringFromBuffer buffer +> assertEqual "testRebind1" (Just expect) s +> -- +> closeCursor stmt +> -- +> let expect = "xyz" +> bindParamBuffer stmt 1 (Just expect) +> executeStmt stmt +> buffer <- bindColBuffer stmt 1 100 (Just "") +> more <- fetch stmt +> s <- getUTF8StringFromBuffer buffer +> assertEqual "testRebind2" (Just expect) s +> -- +> more <- fetch stmt +> assertBool "testBindString: EOD" (not more) +> freeStmt stmt + + +> testIsolationLevel conn = do +> -- For PostgreSQL this fails with: +> -- 206 HY009 Illegal parameter value for SQL_TXN_ISOLATION +> --setTxnIsolation conn sqlTxnReadUncommitted +> setTxnIsolation conn sqlTxnReadCommitted -- This is OK +> -- For PostgreSQL this fails with: +> -- 206 HY009 Illegal parameter value for SQL_TXN_ISOLATION +> --setTxnIsolation conn sqlTxnRepeatableRead +> setTxnIsolation conn sqlTxnSerializable -- This is OK + + +> testlist = +> testCreateStmt : +> testIsolationLevel : +> testFetchString : +> testFetchStringWithBuffer : +> testFetchInt : +> testFetchIntWithBuffer : +> testFetchDouble : +> testFetchDatetime : +> testBindInt : +> testBindString : +> testBindUTCTime : +> testBindUTCTimeBoundary : +> testUTF8 : +> testRebind : +> [] + +> mkTestlist conn testlist = map (\testcase -> printIgnoreError (testcase conn)) testlist + +> parseArgs :: [String] -> IO String +> parseArgs args = do +> let (dsn:_) = args +> return dsn + +> runTest :: [String] -> IO () +> runTest as = do +> connstr <- parseArgs as +> printPropagateError testCreateEnv +> printPropagateError testCreateConn +> printPropagateError (testConnect connstr) +> (env, conn) <- printPropagateError (createConn connstr) +> ignoreError (dropDual conn) +> printPropagateError (createDual conn) +> counts <- runTestTT "ODBC low-level tests" (mkTestlist conn testlist) +> printPropagateError (dropDual conn) +> closeConn (env, conn) +> return ()
+ Database/Oracle/Enumerator.lhs view
@@ -0,0 +1,1042 @@+ +| +Module : Database.Oracle.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Oracle OCI implementation of Database.Enumerator. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-undecidable-instances #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Oracle.Enumerator +> ( Session, connect +> , prepareStmt, preparePrefetch +> , prepareQuery, prepareLargeQuery, prepareCommand, prepareLargeCommand +> , sql, sqlbind, prefetch, cmdbind +> , StmtHandle, Out(..) +> , module Database.Enumerator +> ) +> where + + +> import Database.Enumerator +> import Database.InternalEnumerator +> import Database.Oracle.OCIConstants +> import qualified Database.Oracle.OCIFunctions as OCI +> import Database.Oracle.OCIFunctions +> ( OCIHandle, EnvHandle, ErrorHandle, ServerHandle, ConnHandle, SessHandle, StmtHandle +> , OCIException (..), catchOCI) +> import Foreign +> import Foreign.C +> import Control.Monad +> import Control.Exception +> import Control.Monad.Trans +> import Control.Monad.Reader +> import Data.Char (toLower) +> import Data.Dynamic +> import Data.List (isPrefixOf) +> import Data.IORef +> import Data.Int +> import Data.Time +> import System.Time +> import System.IO (hPutStrLn, stderr) + +> {-# DEPRECATED prepareStmt "Use prepareQuery or prepareCommand instead" #-} +> {-# DEPRECATED preparePrefetch "Use prepareLargeQuery instead" #-} + +-------------------------------------------------------------------- +-- ** Error handling +-------------------------------------------------------------------- + +> nullAction :: IO () +> nullAction = return () + + +> between i (l, u) = i >= l && i <= u + +Where did I find these mappings?... + +> errorSqlState :: Int -> (String, String) +> errorSqlState 0 = ("00", "000") +> -- 02 - no data +> errorSqlState 1403 = ("02", "000") +> errorSqlState 1095 = ("02", "000") +> -- 23 - integrity violation +> errorSqlState 1 = ("23", "000") +> errorSqlState e | e >= 2290 && e <= 2299 = ("23", "000") +> -- 42 - syntax error or access rule violation +> errorSqlState 22 = ("42", "000") +> errorSqlState 251 = ("42", "000") +> errorSqlState e | e `between` (900, 999) = ("42", "000") +> errorSqlState 1031 = ("42", "000") +> errorSqlState e | e `between` (1490, 1493) = ("42", "000") +> errorSqlState e | e `between` (1700, 1799) = ("42", "000") +> errorSqlState e | e `between` (1900, 2099) = ("42", "000") +> errorSqlState e | e `between` (2140, 2289) = ("42", "000") +> errorSqlState e | e `between` (2420, 2424) = ("42", "000") +> errorSqlState e | e `between` (2450, 2499) = ("42", "000") +> errorSqlState e | e `between` (3276, 3299) = ("42", "000") +> errorSqlState e | e `between` (4040, 4059) = ("42", "000") +> errorSqlState e | e `between` (4070, 4099) = ("42", "000") +> -- 08 - connection errors +> errorSqlState 12154 = ("08", "001") -- TNS: can't resolve service name +> -- unspecified error +> errorSqlState _ = ("01", "000") + +> throwSqlError e m = do +> let +> s@(ssc,sssc) = errorSqlState e +> ec = case ssc of +> "XX" -> DBFatal +> "58" -> DBFatal +> "57" -> DBFatal +> "54" -> DBFatal +> "53" -> DBFatal +> "08" -> DBFatal +> _ -> DBError +> throwDB (ec s e m) + + +|rethrow converts an OCIException to a DBException. +The third parameter is an IO action that you can use to clean up any handles. +First we get the error message from the Env or ErrorHandle, +and then we run the cleanup action to free any allocated handles. +(Obviously, we must extract the error message _before_ we free the handles.) +If there's no cleanup action required then simply pass nullAction. + +> class OCIExceptionHandler a where +> rethrow :: a -> OCIException -> IO () -> IO b + +> instance OCIExceptionHandler ErrorHandle where +> rethrow err ex finaliser = do +> (e, m) <- OCI.formatErrorMsg ex err +> finaliser +> throwSqlError e m + +> instance OCIExceptionHandler EnvHandle where +> rethrow env ex finaliser = do +> (e, m) <- OCI.formatEnvMsg ex env +> finaliser +> throwSqlError e m + + +|What do we do if creating the first handle (Environment) fails? +There's no Env- or ErrorHandle to get the error message from, +so do the best we can by constructing a message with formatErrorCodeDesc. +Still throws DBException. + +> reportOCIExc :: OCIException -> IO a +> reportOCIExc (OCIException e m) = do +> let s = OCI.formatErrorCodeDesc e m +> printError s +> throwDB (DBError (errorSqlState 0) 0 s) +> return undefined + +> printError :: String -> IO () +> printError s = hPutStrLn stderr s + +-------------------------------------------------------------------- +-- ** OCI Function Wrappers +-------------------------------------------------------------------- + +These wrappers ensure that only DBExceptions are thrown, +and never OCIExceptions. + +> data Session = Session +> { envHandle :: EnvHandle +> , errorHandle :: ErrorHandle +> , connHandle :: ConnHandle +> } +> deriving Typeable + +> class FreeHandle ht where dispose :: ht -> IO () + +> instance FreeHandle EnvHandle where dispose h = freeHandle (castPtr h) oci_HTYPE_ENV +> instance FreeHandle ErrorHandle where dispose h = freeHandle (castPtr h) oci_HTYPE_ERROR +> instance FreeHandle ServerHandle where dispose h = freeHandle (castPtr h) oci_HTYPE_SERVER +> instance FreeHandle ConnHandle where dispose h = freeHandle (castPtr h) oci_HTYPE_SVCCTX +> instance FreeHandle SessHandle where dispose h = freeHandle (castPtr h) oci_HTYPE_SESSION +> instance FreeHandle StmtHandle where dispose h = freeHandle (castPtr h) oci_HTYPE_STMT + + +|Reports and ignores any errors when freeing handles. +Will catch attempts to free invalid (already freed?) handles. + +> freeHandle :: OCIHandle -> CInt -> IO () +> freeHandle ocihandle handleType = catchOCI ( do +> OCI.handleFree handleType ocihandle +> ) (\(OCIException e m) -> do +> let s = OCI.formatErrorCodeDesc e m +> printError s +> ) + +|Assumes that if an exception is raised, +the Env and Error handles should be freed. + +> inOCI :: EnvHandle -> ErrorHandle -> IO a -> IO a +> inOCI env err action = catchOCI action $ \e -> do +> rethrow err e $ do +> dispose err +> dispose env + + +|Does not free handles when exception raised. + +> inSession :: Session -> (EnvHandle -> ErrorHandle -> ConnHandle -> IO a) -> IO () -> IO a +> inSession session action finaliser = do +> let +> env = envHandle session +> err = errorHandle session +> conn = connHandle session +> catchOCI (action env err conn) (\e -> rethrow err e finaliser) + + +> getEnv :: IO EnvHandle +> getEnv = catchOCI OCI.envCreate reportOCIExc + +> getErr :: EnvHandle -> IO ErrorHandle +> getErr env = catchOCI ( do +> err <- OCI.handleAlloc oci_HTYPE_ERROR (castPtr env) +> return (castPtr err) +> ) (\e -> rethrow env e (dispose env)) + + +> getServer :: EnvHandle -> ErrorHandle -> IO ServerHandle +> getServer env err = inOCI env err $ do +> server <- OCI.handleAlloc oci_HTYPE_SERVER (castPtr env) +> return (castPtr server) + + +> getConnection :: EnvHandle -> ErrorHandle -> IO ConnHandle +> getConnection env err = inOCI env err $ do +> conn <- OCI.handleAlloc oci_HTYPE_SVCCTX (castPtr env) +> return (castPtr conn) + + +> getSessionHandle :: EnvHandle -> ErrorHandle -> IO SessHandle +> getSessionHandle env err = inOCI env err $ do +> session <- OCI.handleAlloc oci_HTYPE_SESSION (castPtr env) +> return (castPtr session) + + +|The idea with multiple logons is to first connect to the server. +Then you create a connection and a session, set the user id details, +and begin the session. +When finished, you end the session, +detach from the server, and free the handles. +So we should have, globally, one EnvHandle and one ErrorHandle, +and then, per session, one ServerHandle, one ConnHandle, and one SessHandle. +Also, for each server (or Instance, in Oracle-speak), we could share +the ServerHandle among the many ConnHandles and SessHandles. +At the moment we're being lazy, +and not reusing the Env and ErrorHandles for new connections. + +> startServerSession :: String -> String -> EnvHandle -> ErrorHandle -> ServerHandle -> IO ConnHandle +> startServerSession user pswd env err server = do +> conn <- getConnection env err +> -- the connection holds a reference to the server in one of its attributes +> OCI.setHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX (castPtr server) oci_ATTR_SERVER +> session <- getSessionHandle env err +> if (user == "") +> then do +> OCI.sessionBegin err conn session oci_CRED_EXT +> else do +> OCI.setHandleAttrString err (castPtr session) oci_HTYPE_SESSION user oci_ATTR_USERNAME +> OCI.setHandleAttrString err (castPtr session) oci_HTYPE_SESSION pswd oci_ATTR_PASSWORD +> OCI.sessionBegin err conn session oci_CRED_RDBMS +> -- the connection also holds a reference to the session in one of its attributes +> OCI.setHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX (castPtr session) oci_ATTR_SESSION +> -- and we need to create a valid transaction handle for the connection, too. +> trans <- OCI.handleAlloc oci_HTYPE_TRANS (castPtr env) +> OCI.setHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX (castPtr trans) oci_ATTR_TRANS +> return conn + + +> logon :: String -> String -> String -> EnvHandle -> ErrorHandle -> IO ConnHandle +> logon user pswd dbname env err = inOCI env err $ do +> server <- getServer env err +> OCI.serverAttach err server dbname +> startServerSession user pswd env err server + + +> logoff :: ErrorHandle -> ConnHandle -> IO () +> logoff err conn = catchOCI (do +> session <- OCI.getHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX oci_ATTR_SESSION +> server <- OCI.getHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX oci_ATTR_SERVER +> OCI.sessionEnd err conn session +> OCI.serverDetach err server +> dispose session +> dispose conn +> dispose server +> ) (\e -> rethrow err e nullAction) + + + + +> dbConnect :: String -> String -> String -> IO Session +> dbConnect user pswd dbname = do +> env <- getEnv +> err <- getErr env +> conn <- logon user pswd dbname env err +> return (Session env err conn) + + + +> dbDisconnect :: Session -> IO () +> dbDisconnect session = do +> let +> env = envHandle session +> err = errorHandle session +> conn = connHandle session +> logoff err conn +> dispose err +> dispose env +> OCI.terminate + + +|Oracle only supports ReadCommitted and Serialisable. +If you ask for RepeatableRead, we must go one better and choose Serialisable +(ReadCommitted is no good because you can get non-reapeatable reads). +Oracle has a ReadOnly mode which will give you RepeatableRead, +but you can't do any updates. + +Oracle's default (and weakest) behaviour is ReadCommitted; +there's no equivalent for ReadUncommitted. + +> beginTrans :: Session -> IsolationLevel -> IO () +> beginTrans session isolation = inSession session +> (\_ err conn -> do +> case isolation of +> ReadUncommitted -> OCI.beginTrans err conn oci_TRANS_READWRITE +> ReadCommitted -> OCI.beginTrans err conn oci_TRANS_READWRITE +> RepeatableRead -> OCI.beginTrans err conn oci_TRANS_SERIALIZABLE +> Serialisable -> OCI.beginTrans err conn oci_TRANS_SERIALIZABLE +> Serializable -> OCI.beginTrans err conn oci_TRANS_SERIALIZABLE +> ) nullAction + + + +> commitTrans :: Session -> IO () +> commitTrans session = inSession session +> (\_ err conn -> OCI.commitTrans err conn) +> nullAction + +> rollbackTrans :: Session -> IO () +> rollbackTrans session = inSession session +> (\_ err conn -> OCI.rollbackTrans err conn) +> nullAction + + + +> getStmt :: Session -> IO StmtHandle +> getStmt session = inSession session +> (\ env err _ -> do +> stmt <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> return (castPtr stmt) +> ) nullAction + + +> closeStmt :: Session -> StmtHandle -> IO () +> closeStmt _ stmt = dispose stmt + + +> setPrefetchCount :: Session -> StmtHandle -> Int -> IO () +> setPrefetchCount session stmt count = inSession session +> (\_ err _ -> with count $ \countPtr -> +> OCI.setHandleAttr err (castPtr stmt) oci_HTYPE_STMT countPtr oci_ATTR_PREFETCH_ROWS +> ) (closeStmt session stmt) + + + +> stmtPrepare :: Session -> StmtHandle -> String -> IO () +> stmtPrepare session stmt sql = inSession session +> (\_ err _ -> OCI.stmtPrepare err stmt sql +> ) (closeStmt session stmt) + + +> word32ToInt :: Word32 -> Int +> word32ToInt n = fromIntegral n + +> getRowCount :: Session -> StmtHandle -> IO Int +> getRowCount session stmt = inSession session +> (\_ err _ -> do +> rc <- OCI.getHandleAttr err (castPtr stmt) oci_HTYPE_STMT oci_ATTR_ROW_COUNT +> return (word32ToInt rc) +> ) (closeStmt session stmt) + + +> execute :: Session -> StmtHandle -> Int -> IO Int +> execute session stmt iterations = inSession session +> (\_ err conn -> do +> OCI.stmtExecute err conn stmt iterations +> getRowCount session stmt +> ) (closeStmt session stmt) + + +> fetchRow :: Session -> PreparedStmtObj -> IO CInt +> fetchRow session stmt = inSession session +> (\_ err _ -> OCI.stmtFetch err (stmtHandle stmt)) +> nullAction -- cleanup handled by doQuery1Maker + + +> defineCol :: Session -> PreparedStmtObj -> Int -> Int -> CInt -> IO OCI.ColumnInfo +> defineCol session stmt posn bufsize sqldatatype = inSession session +> (\_ err _ -> OCI.defineByPos err (stmtHandle stmt) posn bufsize sqldatatype) +> (closeStmt session (stmtHandle stmt)) + +> bindByPos :: Session -> PreparedStmtObj -> Int -> CShort -> OCI.BufferPtr -> Int -> CInt -> IO () +> bindByPos session stmt posn nullind val bufsize sqldatatype = inSession session +> (\_ err _ -> OCI.bindByPos err (stmtHandle stmt) posn nullind val bufsize sqldatatype) +> (closeStmt session (stmtHandle stmt)) + +> bindOutputByPos :: Session -> PreparedStmtObj -> Int -> OCI.BindBuffer -> Int -> CInt -> IO OCI.BindHandle +> bindOutputByPos session stmt posn buffer bufsize sqldatatype = inSession session +> (\_ err _ -> OCI.bindOutputByPos err (stmtHandle stmt) posn buffer bufsize sqldatatype) +> (closeStmt session (stmtHandle stmt)) + +-------------------------------------------------------------------- +-- ** Sessions +-------------------------------------------------------------------- + +> connect :: String -> String -> String -> ConnectA Session +> connect user pswd dbname = ConnectA (dbConnect user pswd dbname) + +-------------------------------------------------------------------- +-- Statements and Commands +-------------------------------------------------------------------- + +==== A wrapper for SQL statements ==== + +When we execute queries with the OCI, +we need to specify how many times the statement should be executed. +For select statements it is zero (!?), while everything else is one +(>1 executions is for array binds). + +For a select, if you have defined output buffers then the iterations +parameter for 'execute' +says how many rows to put in the buffers immediately after the execute +(so there's no need for a call to OCIStmtFetch). +We don't use this, and set up the buffers after the execute. + +So there's a distinction between queries and commands. +Note that PL/SQL blocks which populate output bind buffers +are treated like queries by our library, +so we need some way of distinguishing between queries and commands. + +> newtype QueryString = QueryString String + +> sql :: String -> QueryString +> sql str = QueryString str + + +> instance Command QueryString Session where +> executeCommand sess (QueryString str) = doCommand sess str + +> doCommand sess str = do +> stmt <- getStmt sess +> stmtPrepare sess stmt str +> n <- execute sess stmt 1 +> closeStmt sess stmt +> return (fromIntegral n) + +> instance Command String Session where +> executeCommand sess str = executeCommand sess (sql str) + +> data CommandBind = CommandBind String [BindA Session PreparedStmtObj BindObj] + +> cmdbind :: String -> [BindA Session PreparedStmtObj BindObj] -> CommandBind +> cmdbind sql parms = CommandBind sql parms + +> instance Command CommandBind Session where +> executeCommand sess (CommandBind sqltext bas) = do +> let (PreparationA pa) = prepareStmt' 0 sqltext FreeWithQuery CommandType +> ps <- pa sess +> bindRun sess ps bas (\(BoundStmt bs) -> getRowCount sess (stmtHandle bs)) + +> instance Command BoundStmt Session where +> executeCommand s (BoundStmt pstmt) = +> getRowCount s (stmtHandle pstmt) + + +> instance ISession Session where +> disconnect sess = dbDisconnect sess +> beginTransaction sess isolation = beginTrans sess isolation +> commit sess = commitTrans sess +> rollback sess = rollbackTrans sess + + +We need to keep track of the scope of the PreparedStmtObj +i.e. should it be freed when the Query (result-set) is freed, +or does it have a longer lifetime? +PreparedStmtObjs created by prepareStmt have a lifetime possibly +longer than the result-set; users should use withPreparedStatement +to manage these. + +PreparedStmtObjs can also be created internally by various instances +of makeQuery (in class Statement), and these will usually have the +same lifetime/scope as that of the Query (result-set). + +> data StmtLifetime = FreeWithQuery | FreeManually + +We also need to note if the statement is a query (select) +or some sort of command. This influences subsequent behaviour in two ways: + 1. when execute is done, we specify either 0 or 1 iterations, + for selects or or commands, respectively (see bindRun) + 2. when fetchRow is called by doQuery, for selects we call OCI stmtFetch, + but for commands we ignore the call (do nothing). + +> data StmtType = SelectType | CommandType + +> data PreparedStmtObj = PreparedStmtObj +> { stmtLifetime :: StmtLifetime +> , stmtType :: StmtType +> , stmtHandle :: StmtHandle +> , stmtSession :: Session +> , stmtCursors :: IORef [RefCursor StmtHandle] +> -- stmtBuffers are actually output bind buffers. +> -- we package them to look like ColumnBuffers +> -- (as created by allocBuffer) so that we can use them +> -- like ColumnBuffers. +> , stmtBuffers :: IORef [ColumnBuffer] +> } + +Shouldn't need this code now: + +> beginsWithSelect "" = False +> beginsWithSelect text = isPrefixOf "select" . map toLower $ text +> inferStmtType text = if beginsWithSelect text then SelectType else CommandType + +> prepareStmt :: QueryString -> PreparationA Session PreparedStmtObj +> prepareStmt (QueryString sqltext) = +> prepareStmt' (prefetchRowCount defaultResourceUsage) sqltext FreeManually (inferStmtType sqltext) + +> preparePrefetch :: Int -> QueryString -> PreparationA Session PreparedStmtObj +> preparePrefetch count (QueryString sqltext) = +> prepareStmt' count sqltext FreeManually (inferStmtType sqltext) + +> prepareQuery :: QueryString -> PreparationA Session PreparedStmtObj +> prepareQuery (QueryString sqltext) = +> prepareStmt' (prefetchRowCount defaultResourceUsage) sqltext FreeManually SelectType + +> prepareLargeQuery :: Int -> QueryString -> PreparationA Session PreparedStmtObj +> prepareLargeQuery count (QueryString sqltext) = +> prepareStmt' count sqltext FreeManually SelectType + +> prepareCommand :: QueryString -> PreparationA Session PreparedStmtObj +> prepareCommand (QueryString sqltext) = +> prepareStmt' 0 sqltext FreeManually CommandType + +| Seems like an odd alternative to 'prepareCommand' (what is a large command?) +but is actually useful for when the outer query it a procedure call that +returns one or more cursors. The prefetch count for the inner cursors is +inherited from the outer statement, which in this case is a command, rather +than a select. Normally prefetch would be irrelevant (and indeed it is for +the outer command), but we also save it in the statement so that it can be +reused for the child cursors. + +> prepareLargeCommand :: Int -> QueryString -> PreparationA Session PreparedStmtObj +> prepareLargeCommand n (QueryString sqltext) = +> prepareStmt' n sqltext FreeManually CommandType + +> prepareStmt' count sqltext lifetime stmtype = +> PreparationA (\sess -> do +> stmt <- getStmt sess +> stmtPrepare sess stmt (OCI.substituteBindPlaceHolders sqltext) +> setPrefetchCount sess stmt count +> newPreparedStmt lifetime stmtype sess stmt +> ) + +> newPreparedStmt lifetime iteration sess stmt = do +> c <- newIORef [] +> b <- newIORef [] +> return (PreparedStmtObj lifetime iteration stmt sess c b) + +-------------------------------------------------------------------- +-- ** Binding +-------------------------------------------------------------------- + +> newtype BoundStmt = BoundStmt { boundStmt :: PreparedStmtObj } + +> type BindObj = Int -> IO () +> newtype Out a = Out a + +> instance IPrepared PreparedStmtObj Session BoundStmt BindObj where +> bindRun sess stmt bas action = do +> sequence_ (zipWith (\i (BindA ba) -> ba sess stmt i) [1..] bas) +> let iteration = case (stmtType stmt) of +> SelectType -> 0 +> CommandType -> 1 +> execute sess (stmtHandle stmt) iteration +> writeIORef (stmtCursors stmt) [] +> -- after execute, save any RefCursor Out values... +> -- or should we save all Out values? +> action (BoundStmt stmt) +> destroyStmt sess pstmt = closeStmt sess (stmtHandle pstmt) + +> instance DBBind (Maybe String) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +Disable this for now, as Strings have charset conversion issues for me... + +> instance DBBind (Out (Maybe String)) Session PreparedStmtObj BindObj where +> bindP (Out v) = makeOutputBindAction v + +> instance DBBind (Maybe Int) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Out (Maybe Int)) Session PreparedStmtObj BindObj where +> bindP (Out v) = makeOutputBindAction v + +I don't think Oracle supports int64 in v8i's OCI API... + + instance DBBind (Maybe Int64) Session PreparedStmtObj BindObj where + bindP = makeBindAction + +> instance DBBind (Maybe Double) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Out (Maybe Double)) Session PreparedStmtObj BindObj where +> bindP (Out v) = makeOutputBindAction v + +> instance DBBind (Maybe CalendarTime) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe UTCTime) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Out (Maybe UTCTime)) Session PreparedStmtObj BindObj where +> bindP (Out v) = makeOutputBindAction v + +StmtHandles (i.e. RefCursors) are output only, I think +(altough you have to pass a valid one in, or it'll hurl). +We create the StmtHandle here, so the user doesn't have to +(is this a bad idea?...) + +> instance DBBind (Out (Maybe StmtHandle)) Session PreparedStmtObj BindObj where +> bindP (Out v) = BindA (\sess stmt pos -> do +> stmt2 <- getStmt sess +> bindOutputMaybe sess stmt (Just stmt2) pos +> ) + + + +Instances for non-Maybe types i.e. bare Int, Double, String, etc. + +> instance DBBind (Maybe a) Session PreparedStmtObj BindObj +> => DBBind a Session PreparedStmtObj BindObj where +> bindP x = bindP (Just x) + +> instance DBBind (Out (Maybe a)) Session PreparedStmtObj BindObj +> => DBBind (Out a) Session PreparedStmtObj BindObj where +> bindP (Out x) = bindP (Out (Just x)) + +Default instances, using generic Show. + +> instance (Show a) => DBBind (Maybe a) Session PreparedStmtObj BindObj where +> bindP (Just x) = bindP (Just (show x)) +> bindP Nothing = bindP (Nothing `asTypeOf` Just "") + +> instance (Show a) => DBBind (Out (Maybe a)) Session PreparedStmtObj BindObj where +> bindP (Out (Just x)) = bindP (Out (Just (show x))) +> bindP (Out Nothing) = bindP (Out (Nothing `asTypeOf` Just "")) + + +> makeBindAction x = BindA (\ses st -> bindMaybe ses st x) + +> bindMaybe :: (OracleBind a) +> => Session -> PreparedStmtObj -> Maybe a -> Int -> IO () +> bindMaybe sess stmt v pos = +> bindWithValue v $ \ptrv -> do +> bindByPos sess stmt pos (bindNullInd v) (castPtr ptrv) (bindSize v) (bindType v) + +Note currying... we don't provide the column-position; +it's provided when bindRun is invoked. + +> makeOutputBindAction v = BindA (\sess stmt -> bindOutputMaybe sess stmt v) + +> bindOutputMaybe :: (OracleBind a) +> => Session -> PreparedStmtObj -> Maybe a -> Int -> IO () +> bindOutputMaybe sess stmt v pos = do +> buffer <- mallocForeignPtrBytes (bindBufferSize v) +> nullind <- mallocForeignPtr +> sizeind <- mallocForeignPtr +> withForeignPtr buffer $ \bufptr -> do +> withForeignPtr nullind $ \indptr -> do +> withForeignPtr sizeind $ \szeptr -> do +> poke (castPtr indptr) (bindNullInd v) +> poke (castPtr szeptr) (bindSize v) +> bindWriteBuffer (castPtr bufptr) v +> bindOutputByPos sess stmt pos (nullind, buffer, sizeind) (bindSize v) (bindType v) +> let +> colbuf = ColumnBuffer +> { colBufBufferFPtr = buffer +> , colBufNullFPtr = nullind +> , colBufSizeFPtr = sizeind +> , colBufColPos = 0 +> , colBufSqlType = (bindType v) +> } +> appendOutputBindBuffer stmt colbuf + +If the bind values are output, then we save them in a list. +We can then use a doQuery to fetch the values, +just like the Postgres technique of returning values +as a set of tuples. +I guess there'll only ever be a single row to fetch +in the Oracle case, though. + +> appendOutputBindBuffer stmt buffer = do +> buffers <- readIORef (stmtBuffers stmt) +> modifyIORef (stmtBuffers stmt) (++ [buffer { colBufColPos = 1 + length buffers }]) + + + + +> class OracleBind a where +> bindWithValue :: a -> (Ptr Word8 -> IO ()) -> IO () +> bindWriteBuffer :: Ptr Word8 -> a -> IO () +> bindSize :: a -> Int +> bindBufferSize :: a -> Int +> bindBufferSize v = bindSize v +> bindNullInd :: a -> CShort +> bindType :: a -> CInt + +> instance OracleBind a => OracleBind (Maybe a) where +> bindWithValue (Just v) a = bindWithValue v a +> bindWithValue Nothing a = return () +> bindWriteBuffer b (Just v) = bindWriteBuffer b v +> bindWriteBuffer b Nothing = return () +> bindSize (Just v) = bindSize v +> bindSize Nothing = 0 +> bindNullInd (Just v) = 0 +> bindNullInd Nothing = -1 +> bindType (Just v) = bindType v +> bindType Nothing = bindType (undefined :: a) + +> instance OracleBind String where +> bindWithValue v a = withCString v (\p -> a (castPtr p)) +> bindWriteBuffer b s = withCStringLen s (\(p,l) -> copyBytes p (castPtr b) l) +> bindSize s = fromIntegral (length s) +> bindBufferSize s = 16000 +> bindNullInd _ = 0 +> bindType _ = oci_SQLT_CHR + +> instance OracleBind Int where +> bindWithValue v a = withBinaryValue toCInt v (\p v -> poke (castPtr p) v) a +> bindWriteBuffer b v = poke (castPtr b) v +> bindSize _ = (sizeOf (toCInt 0)) +> bindNullInd _ = 0 +> bindType _ = oci_SQLT_INT + +> instance OracleBind Double where +> bindWithValue v a = withBinaryValue toCDouble v (\p v -> poke (castPtr p) v) a +> bindWriteBuffer b v = poke (castPtr b) v +> bindSize _ = (sizeOf (toCDouble 0.0)) +> bindNullInd _ = 0 +> bindType _ = oci_SQLT_FLT + +> instance OracleBind CalendarTime where +> bindWithValue v a = withBinaryValue id v (\p dt -> calTimeToBuffer (castPtr p) dt) a +> bindWriteBuffer b v = calTimeToBuffer (castPtr b) v +> bindSize _ = 7 +> bindNullInd _ = 0 +> bindType _ = oci_SQLT_DAT + +> instance OracleBind UTCTime where +> bindWithValue v a = withBinaryValue id v (\p dt -> utcTimeToBuffer (castPtr p) dt) a +> bindWriteBuffer b v = utcTimeToBuffer (castPtr b) v +> bindSize _ = 7 +> bindNullInd _ = 0 +> bindType _ = oci_SQLT_DAT + +> instance OracleBind StmtHandle where +> bindWithValue v a = alloca (\p -> poke p v >> a (castPtr p)) +> bindWriteBuffer b v = poke (castPtr b) v +> bindSize _ = sizeOf nullPtr +> bindNullInd _ = 0 +> bindType _ = oci_SQLT_RSET + +> withBinaryValue :: (OracleBind b) => +> (b -> a) -- ^ convert Haskell value to C value +> -> b -- ^ value to convert (we call bindSize on this value to get buffer size) +> -> (Ptr Word8 -> a -> IO ()) -- ^ action to place converted value into buffer +> -> (Ptr Word8 -> IO ()) -- ^ action to run over buffer; buffer will be freed on completion +> -> IO () +> withBinaryValue fn v pok action = +> allocaBytes (bindSize v) $ \p -> do +> pok p (fn v) +> action (castPtr p) + +> clength = fromIntegral . length + +> toCInt :: Int -> CInt; toCInt = fromIntegral +> fromCInt :: CInt -> Int; fromCInt = fromIntegral +> toCChar :: Char -> CChar; toCChar = toEnum . fromEnum +> fromCChar :: CChar -> Char; fromCChar = toEnum . fromEnum +> toCDouble :: Double -> CDouble; toCDouble = realToFrac +> fromCDouble :: CDouble -> Double; fromCDouble = realToFrac +> toCFloat :: Float -> CFloat; toCFloat = realToFrac +> fromCFloat :: CFloat -> Float; fromCFloat = realToFrac + + +-------------------------------------------------------------------- +-- ** Queries +-------------------------------------------------------------------- + +We save a reference to the parent PreparedStmtObj. +In a lot of cases (the simple ones) the parent is that same +as the PreparedStmtObj. +It only differs when we use the NextResultSet instance of makeQuery. +It is only Nothing when we are processing a RefCursor; +in this case we don't want to save any nested cursors returned +by the query. + +> data Query = Query +> { queryStmt :: PreparedStmtObj +> , querySess :: Session +> , queryParent :: Maybe PreparedStmtObj +> } + + +> data QueryResourceUsage = QueryResourceUsage { prefetchRowCount :: Int } + +> defaultResourceUsage :: QueryResourceUsage +> defaultResourceUsage = QueryResourceUsage 100 -- sensible default? + +> data QueryStringTuned = QueryStringTuned QueryResourceUsage String [BindA Session PreparedStmtObj BindObj] + +> sqlbind :: String -> [BindA Session PreparedStmtObj BindObj] -> QueryStringTuned +> sqlbind sql parms = QueryStringTuned defaultResourceUsage sql parms + +> prefetch :: Int -> String -> [BindA Session PreparedStmtObj BindObj] -> QueryStringTuned +> prefetch count sql parms = QueryStringTuned (QueryResourceUsage count) sql parms + +> instance Statement BoundStmt Session Query where +> makeQuery sess bstmt = return (Query (boundStmt bstmt) sess (Just (boundStmt bstmt))) + +> instance Statement PreparedStmtObj Session Query where +> makeQuery sess pstmt = return (Query pstmt sess (Just pstmt)) + +> instance Statement QueryString Session Query where +> makeQuery sess (QueryString sqltext) = makeQuery sess sqltext + +> instance Statement String Session Query where +> makeQuery sess sqltext = makeQuery sess (QueryStringTuned defaultResourceUsage sqltext []) + +Important to use FreeManually here... +If we destroy the StmtHandle when the query is done, +it does not allow us to re-use the StmtHandle, +which is vital for nested cursors +(mainly because I haven't figured out how to +marshal StmtHandles back to Haskell-land). +However, this means we have to process StmtHandles +immediately; we can't save them up and process them later, +after the parent query is done. + +Contrast this with the Postgres back-end, where the RefCursor +just contains a String, which is the cursor name. +It's no trouble to marshal a String back to Haskell-land. + +> instance Statement (RefCursor StmtHandle) Session Query where +> makeQuery sess (RefCursor stmt) = do +> pstmt <- newPreparedStmt FreeManually SelectType sess stmt +> return (Query pstmt sess Nothing) + +For NextResultSet, we call makeQuery passing (RefCursor StmtHandle). +This creates a query with no parent statement. +All other instances of Statement make a statement its own parent. + +> instance Statement (NextResultSet mark PreparedStmtObj) Session Query where +> makeQuery sess (NextResultSet (PreparedStmt pstmt)) = do +> cursors <- readIORef (stmtCursors pstmt) +> if null cursors then throwDB (DBError ("02", "000") (-1) "No more result sets to process.") else return () +> writeIORef (stmtCursors pstmt) (tail cursors) +> makeQuery sess (head cursors) + +> instance Statement QueryStringTuned Session Query where +> makeQuery sess (QueryStringTuned resUsage sqltext bas) = do +> let +> (PreparationA action) = +> prepareStmt' (prefetchRowCount resUsage) sqltext FreeWithQuery SelectType +> pstmt <- action sess +> sequence_ (zipWith (\i (BindA ba) -> ba sess pstmt i) [1..] bas) +> execute sess (stmtHandle pstmt) 0 +> return (Query pstmt sess (Just pstmt)) + + +> data ColumnBuffer = ColumnBuffer +> { colBufBufferFPtr :: OCI.ColumnResultBuffer +> , colBufNullFPtr :: ForeignPtr CShort +> , colBufSizeFPtr :: ForeignPtr CUShort +> , colBufColPos :: Int +> , colBufSqlType :: CInt +> } + +> instance IQuery Query Session ColumnBuffer where +> destroyQuery query = do +> let pstmt = queryStmt query +> case stmtLifetime pstmt of +> FreeWithQuery -> closeStmt (stmtSession pstmt) (stmtHandle pstmt) +> _ -> return () +> fetchOneRow query = do +> let pstmt = queryStmt query +> case stmtType pstmt of +> SelectType -> do +> rc <- fetchRow (querySess query) (queryStmt query) +> return (rc /= oci_NO_DATA) +> -- True here means fetch will never terminate; +> -- it will always give the same row over and over, +> -- so you'd better be careful with your iteratees +> _ -> return True +> currentRowNum query = +> getRowCount (querySess query) (stmtHandle (queryStmt query)) +> freeBuffer q buffer = return () + + +This is where we differ the behaviour depending on the +type of statement: is it a regular query, +where we just create column buffers, or do we have +bind output buffers, in which case we return those +as the column buffers? + +> allocBuffer query (bufsize, ociBufferType) colpos = do +> buffers <- readIORef (stmtBuffers (queryStmt query)) +> if null buffers +> then do +> (_, buf, nullptr, sizeptr) <- liftIO $ defineCol (querySess query) (queryStmt query) colpos bufsize ociBufferType +> return $ ColumnBuffer +> { colBufBufferFPtr = buf +> , colBufNullFPtr = nullptr +> , colBufSizeFPtr = sizeptr +> , colBufColPos = colpos +> , colBufSqlType = ociBufferType +> } +> else do +> if length buffers >= colpos +> then return (buffers !! (colpos - 1)) +> else -- FIXME use DBError here! +> throwDB (DBError ("02", "000") (-1) ( "There are " ++ show (length buffers) +> ++ " output buffers, but you have asked for buffer " ++ show colpos )) + +When you allocate a StmtHandle buffer, you have to populate it with +a valid StmtHandle before you call fetch. + +> allocStmtBuffer query colpos = do +> colbuf <- allocBuffer query (sizeOf nullPtr, oci_SQLT_RSET) colpos +> buffers <- readIORef (stmtBuffers (queryStmt query)) +> if null buffers +> then do +> -- If this is a define buffer (as opposed to bind buffer) +> -- then shove a valid StmtHandle into it. +> stmt <- getStmt (querySess query) +> withForeignPtr (colBufBufferFPtr colbuf) $ \p -> poke (castPtr p) stmt +> else return () +> return colbuf + + +> bufferToString :: ColumnBuffer -> IO (Maybe String) +> bufferToString buffer = OCI.bufferToString (undefined, colBufBufferFPtr buffer, colBufNullFPtr buffer, colBufSizeFPtr buffer) + +> bufferToCaltime :: ColumnBuffer -> IO (Maybe CalendarTime) +> bufferToCaltime buffer = OCI.bufferToCaltime (colBufNullFPtr buffer) (colBufBufferFPtr buffer) + +> bufferToUTCTime :: ColumnBuffer -> IO (Maybe UTCTime) +> bufferToUTCTime buffer = OCI.bufferToUTCTime (colBufNullFPtr buffer) (colBufBufferFPtr buffer) + +> calTimeToBuffer :: OCI.BufferPtr -> CalendarTime -> IO () +> calTimeToBuffer buf ct = OCI.calTimeToBuffer buf ct + +> utcTimeToBuffer :: OCI.BufferPtr -> UTCTime -> IO () +> utcTimeToBuffer buf utc = OCI.utcTimeToBuffer buf utc + +> bufferToInt :: ColumnBuffer -> IO (Maybe Int) +> bufferToInt buffer = OCI.bufferToInt (colBufNullFPtr buffer) (colBufBufferFPtr buffer) + +> bufferToDouble :: ColumnBuffer -> IO (Maybe Double) +> bufferToDouble buffer = OCI.bufferToDouble (colBufNullFPtr buffer) (colBufBufferFPtr buffer) + +> bufferToStmtHandle :: ColumnBuffer -> IO (RefCursor StmtHandle) +> bufferToStmtHandle buffer = do +> v <- OCI.bufferToStmtHandle (colBufBufferFPtr buffer) +> return (RefCursor v) + + +Right now the StmtHandle in the buffer is updated with a new +cursor on each fetch. +If we call defineByPos before each fetch then we can provide +a fresh StmtHandle for each fetch (thus preserving the handles +from previous fetches), but this will require support from +Database.Enumerator i.e. we need to add a function, say reallocBuffers, +which is called before each row is fetched, +which will give us an opportunity to reallocate memory for buffers +if it is required. +This might be a bad idea though, because it is likely to lead +to space leaks. Perhaps the current approach of reusing the +StmtHandle is better from a memory management point-of-view. +That said, the Oracle DBMS has a fairly low limit (on the order +of 100 or so) on the number of open cursors, so perhaps space +leaks aren't as likely as I think. + +> instance DBType (RefCursor StmtHandle) Query ColumnBuffer where +> allocBufferFor _ q n = allocStmtBuffer q n +> fetchCol q buffer = do +> rawstmt <- OCI.bufferToStmtHandle (colBufBufferFPtr buffer) +> appendRefCursor q (RefCursor rawstmt) + +> appendRefCursor query refc = do +> case queryParent query of +> -- no parent stmt? => probably just a doQuery over a RefCursor. +> -- Don't bother saving returned RefCursors. +> Nothing -> return () +> Just pstmt -> modifyIORef (stmtCursors pstmt) (++ [refc]) +> return refc + + +> instance DBType (Maybe String) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q (16000, oci_SQLT_CHR) n +> fetchCol q buffer = bufferToString buffer + +> instance DBType (Maybe Int) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q (4, oci_SQLT_INT) n +> fetchCol q buffer = bufferToInt buffer + +> instance DBType (Maybe Double) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q (8, oci_SQLT_FLT) n +> fetchCol q buffer = bufferToDouble buffer + +> instance DBType (Maybe UTCTime) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q (7, oci_SQLT_DAT) n +> fetchCol q buffer = bufferToUTCTime buffer + +> instance DBType (Maybe CalendarTime) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q (7, oci_SQLT_DAT) n +> fetchCol q buffer = bufferToCaltime buffer + +|This single polymorphic instance covers all of the +type-specific non-Maybe instances e.g. String, Int, Double, etc. + +> instance DBType (Maybe a) Query ColumnBuffer +> => DBType a Query ColumnBuffer where +> allocBufferFor v q n = allocBufferFor (Just v) q n +> fetchCol q buffer = throwIfDBNull (buffer_pos q buffer) (fetchCol q buffer) + +> buffer_pos q buffer = do +> row <- currentRowNum q +> return (row, colBufColPos buffer) + + +|A polymorphic instance which assumes that the value is in a String column, +and uses Read to convert the String to a Haskell data value. + +> instance (Show a, Read a) => DBType (Maybe a) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q (16000, oci_SQLT_CHR) n +> fetchCol q buffer = do +> v <- bufferToString buffer +> case v of +> Just s -> if s == "" then return Nothing else return (Just (read s)) +> Nothing -> return Nothing
+ Database/Oracle/OCIConstants.lhs view
@@ -0,0 +1,178 @@+ +| +Module : Database.Oracle.OCIConstants +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Contains CInt equivalents of the #defines in the oci library headers. +This is not a complete set; just enough to get the Haskell libraries working. +This also might not be particularly portable, but I don't think Oracle are going +to change these in a hurry (that would break compiled programs, wouldn't it?). + + +> module Database.Oracle.OCIConstants where + +> import Foreign.C.Types + + +** Used all over the place: + +> oci_DEFAULT :: CInt +> oci_DEFAULT = 0 + + +** Handle types: + +| Found in $ORAHOME\/oci\/include\/oci.h + +> [ oci_HTYPE_ENV +> , oci_HTYPE_ERROR +> , oci_HTYPE_SVCCTX +> , oci_HTYPE_STMT +> , oci_HTYPE_BIND +> , oci_HTYPE_DEFINE +> , oci_HTYPE_DESCRIBE +> , oci_HTYPE_SERVER +> , oci_HTYPE_SESSION +> , oci_HTYPE_TRANS +> ] = [1..10] :: [CInt] + + +** Error code types: + +| Found in $ORAHOME\/oci\/include\/oci.h + +> [ oci_SUCCESS +> , oci_SUCCESS_WITH_INFO +> , oci_RESERVED_FOR_INT_USE +> , oci_NO_DATA +> , oci_ERROR +> , oci_INVALID_HANDLE +> , oci_NEED_DATA +> , oci_STILL_EXECUTING +> , oci_CONTINUE +> ] = +> [0, 1, 200, 100, -1, -2, 99, -3123, -24200] :: [CInt] + + + +** Attribute types: + +| Found in $ORAHOME\/oci\/include\/oci.h + +> [ oci_ATTR_ENV +> , oci_ATTR_SERVER +> , oci_ATTR_SESSION +> , oci_ATTR_TRANS +> , oci_ATTR_ROW_COUNT +> , oci_ATTR_PREFETCH_ROWS +> , oci_ATTR_USERNAME +> , oci_ATTR_PASSWORD +> ] = [5,6,7,8,9,11,22,23] :: [CInt] + +** Authentication options: + +| Found in $ORAHOME\/oci\/include\/oci.h + +> oci_CRED_RDBMS :: CInt +> oci_CRED_RDBMS = 1 +> oci_CRED_EXT :: CInt +> oci_CRED_EXT = 2 +> oci_CRED_PROXY :: CInt +> oci_CRED_PROXY = 3 + + + +** Syntax types (i.e. does the DBMS understand v7 or v8 syntax, etc): + +| Found in $ORAHOME\/oci\/include\/oci.h + +> oci_NTV_SYNTAX :: CInt +> oci_NTV_SYNTAX = 1 + + + +** Scrollable Cursor Options: + +| Found in $ORAHOME\/oci\/include\/oci.h + +> oci_FETCH_NEXT :: CInt +> oci_FETCH_NEXT = 2 +> oci_FETCH_FIRST :: CInt +> oci_FETCH_FIRST = 4 +> oci_FETCH_LAST :: CInt +> oci_FETCH_LAST = 8 +> oci_FETCH_PRIOR :: CInt +> oci_FETCH_PRIOR = 16 +> oci_FETCH_ABSOLUTE :: CInt +> oci_FETCH_ABSOLUTE = 32 +> oci_FETCH_RELATIVE :: CInt +> oci_FETCH_RELATIVE = 64 +> oci_FETCH_RESERVED :: CInt +> oci_FETCH_RESERVED = 128 + + + + +** OCI datatypes: + +| Found in $ORAHOME\/oci\/include\/ocidfn.h + +> oci_SQLT_CHR :: CInt +> oci_SQLT_CHR = 1 +> oci_SQLT_NUM :: CInt +> oci_SQLT_NUM = 2 +> oci_SQLT_INT :: CInt +> oci_SQLT_INT = 3 +> oci_SQLT_FLT :: CInt +> oci_SQLT_FLT = 4 +> oci_SQLT_STR :: CInt +> oci_SQLT_STR = 5 +> oci_SQLT_VNU :: CInt +> oci_SQLT_VNU = 6 +> oci_SQLT_LNG :: CInt +> oci_SQLT_LNG = 8 +> oci_SQLT_VCS :: CInt +> oci_SQLT_VCS = 9 +> oci_SQLT_RID :: CInt +> oci_SQLT_RID = 11 +> oci_SQLT_DAT :: CInt +> oci_SQLT_DAT = 12 +> oci_SQLT_VBI :: CInt +> oci_SQLT_VBI = 15 +> oci_SQLT_BIN :: CInt +> oci_SQLT_BIN = 23 +> oci_SQLT_LBI :: CInt +> oci_SQLT_LBI = 24 +> oci_SQLT_UIN :: CInt +> oci_SQLT_UIN = 68 +> oci_SQLT_LVC :: CInt +> oci_SQLT_LVC = 94 +> oci_SQLT_LVB :: CInt +> oci_SQLT_LVB = 95 +> oci_SQLT_AFC :: CInt +> oci_SQLT_AFC = 96 +> oci_SQLT_AVC :: CInt +> oci_SQLT_AVC = 97 +> oci_SQLT_RSET :: CInt +> oci_SQLT_RSET = 116 + + + +** Transaction types; parameters for ociTransStart. + +| Found in $ORAHOME\/oci\/include\/oci.h. +There are more than this, but they're related to complicated +transaction-management stuff in the OCI libraries that I don't understand. +These should be sufficient to support the simple transaction model +understood by most developers. + +> oci_TRANS_READONLY :: CInt +> oci_TRANS_READONLY = 0x00000100 -- 256 +> oci_TRANS_READWRITE :: CInt +> oci_TRANS_READWRITE = 0x00000200 -- 512 +> oci_TRANS_SERIALIZABLE :: CInt +> oci_TRANS_SERIALIZABLE = 0x00000400 -- 1024
+ Database/Oracle/OCIFunctions.lhs view
@@ -0,0 +1,811 @@+ +| +Module : Database.Oracle.OCIFunctions +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Simple wrappers for OCI functions (FFI). + +The functions in this file are simple wrappers for OCI functions. +The wrappers add error detection and exceptions; +functions in this module raise 'OCIException'. +The next layer up traps these and turns them into 'Database.Enumerator.DBException'. + +Note that 'OCIException' /does not/ contain the error number and text +returned by 'getOCIErrorMsg'. +It is the job of the next layer (module) up to catch the 'OCIException' +and then call 'getOCIErrorMsg' to get the actual error details. +The 'OCIException' simply contains the error number returned by +the OCI call, and some text identifying the wrapper function. +See 'formatErrorCodeDesc' for the set of possible values for the OCI error numbers. + +> {-# OPTIONS -ffi #-} +> {-# OPTIONS -fglasgow-exts #-} + + +> module Database.Oracle.OCIFunctions where + + +> import Database.Oracle.OCIConstants +> import Database.Util +> import Foreign +> import Foreign.C +> import Control.Monad +> import Control.Exception +> import Data.Dynamic +> import System.Time +> import Data.Time + + + +| + * Each handle type has its own data type, to prevent stupid errors + i.e. using the wrong handle at the wrong time. + + * In GHC you can simply say @data OCIStruct@ i.e. there's no need for @= OCIStruct@. + I've decided to be more portable, as it doesn't cost much. + + * Use castPtr if you need to convert handles (say 'OCIHandle' to a more specific type, or vice versa). + +> data OCIStruct = OCIStruct +> type OCIHandle = Ptr OCIStruct -- generic Handle for OCI functions that return Handles +> data OCIBuffer = OCIBuffer -- generic buffer. Could hold anything: value or pointer. +> type BufferPtr = Ptr OCIBuffer +> type BufferFPtr = ForeignPtr OCIBuffer +> type ColumnResultBuffer = ForeignPtr OCIBuffer -- use ForeignPtr to ensure GC'd +> -- triple of (nullind, buffer, size) +> type BindBuffer = (ForeignPtr CShort, ForeignPtr OCIBuffer, ForeignPtr CUShort) +> data Context = Context +> type ContextPtr = Ptr Context + +> data EnvStruct = EnvStruct +> type EnvHandle = Ptr EnvStruct +> data ErrorStruct = ErrorStruct +> type ErrorHandle = Ptr ErrorStruct +> data ServerStruct = ServerStruct +> type ServerHandle = Ptr ServerStruct +> data UserStruct = UserStruct +> type UserHandle = Ptr UserStruct +> data ConnStruct = ConnStruct +> type ConnHandle = Ptr ConnStruct -- AKA Service Context +> data SessStruct = SessStruct +> type SessHandle = Ptr SessStruct +> data StmtStruct = StmtStruct +> type StmtHandle = Ptr StmtStruct +> data DefnStruct = DefnStruct +> type DefnHandle = Ptr DefnStruct +> data ParamStruct = ParamStruct +> type ParamHandle = Ptr ParamStruct +> data BindStruct = BindStruct +> type BindHandle = Ptr BindStruct +> type ColumnInfo = (DefnHandle, ColumnResultBuffer, ForeignPtr CShort, ForeignPtr CUShort) + + +|Low-level, OCI library errors. + +> data OCIException = OCIException CInt String +> deriving (Typeable, Show) + +If we can't derive Typeable then the following code should do the trick: + + > data OCIException = OCIException CInt String + > ociExceptionTc :: TyCon + > ociExceptionTc = mkTyCon "Database.Oracle.OCIFunctions.OCIException" + > instance Typeable OCIException where typeOf _ = mkAppTy ociExceptionTc [] + + +> catchOCI :: IO a -> (OCIException -> IO a) -> IO a +> catchOCI = catchDyn + +> throwOCI :: OCIException -> a +> throwOCI = throwDyn + + + +> mkCInt :: Int -> CInt +> mkCInt n = fromIntegral n + +> mkCShort :: CInt -> CShort +> mkCShort n = fromIntegral n + +> mkCUShort :: CInt -> CUShort +> mkCUShort n = fromIntegral n + +> cStrLen :: CStringLen -> CInt +> cStrLen = mkCInt . snd + +> cStr :: CStringLen -> CString +> cStr = fst + + + +--------------------------------------------------------------------------------- +-- ** Foreign OCI functions +--------------------------------------------------------------------------------- + + +> foreign import ccall "OCIEnvCreate" ociEnvCreate :: Ptr EnvHandle -> CInt -> Ptr a -> FunPtr a -> FunPtr a -> FunPtr a -> CInt -> Ptr (Ptr a) -> IO CInt +> foreign import ccall "OCIHandleAlloc" ociHandleAlloc :: OCIHandle -> Ptr OCIHandle -> CInt -> CInt -> Ptr a -> IO CInt +> foreign import ccall "oci.h OCIHandleFree" ociHandleFree :: OCIHandle -> CInt -> IO CInt +> foreign import ccall "oci.h OCIErrorGet" ociErrorGet :: OCIHandle -> CInt -> CString -> Ptr CInt -> CString -> CInt -> CInt -> IO CInt + + +> foreign import ccall "oci.h OCIParamGet" ociParamGet :: OCIHandle -> CInt -> ErrorHandle -> Ptr OCIHandle -> CInt -> IO CInt +> foreign import ccall "oci.h OCIAttrGet" ociAttrGet +> :: OCIHandle -> CInt -> BufferPtr -> Ptr CInt -> CInt -> ErrorHandle -> IO CInt +> foreign import ccall "oci.h OCIAttrSet" ociAttrSet +> :: OCIHandle -> CInt -> BufferPtr -> CInt -> CInt -> ErrorHandle -> IO CInt + + +> foreign import ccall "oci.h OCILogon" ociLogon +> :: EnvHandle -> ErrorHandle -> Ptr ConnHandle -> CString -> CInt -> CString -> CInt -> CString -> CInt -> IO CInt +> foreign import ccall "oci.h OCILogoff" ociLogoff :: ConnHandle -> ErrorHandle -> IO CInt +> foreign import ccall "oci.h OCISessionBegin" ociSessionBegin :: ConnHandle -> ErrorHandle -> SessHandle -> CInt -> CInt -> IO CInt +> foreign import ccall "oci.h OCISessionEnd" ociSessionEnd :: ConnHandle -> ErrorHandle -> SessHandle -> CInt -> IO CInt +> foreign import ccall "oci.h OCIServerAttach" ociServerAttach :: ServerHandle -> ErrorHandle -> CString -> CInt -> CInt -> IO CInt +> foreign import ccall "oci.h OCIServerDetach" ociServerDetach :: ServerHandle -> ErrorHandle -> CInt -> IO CInt +> foreign import ccall "oci.h OCITerminate" ociTerminate :: CInt -> IO CInt + +> foreign import ccall "oci.h OCITransStart" ociTransStart :: ConnHandle -> ErrorHandle -> Word8 -> CInt -> IO CInt +> foreign import ccall "oci.h OCITransCommit" ociTransCommit :: ConnHandle -> ErrorHandle -> CInt -> IO CInt +> foreign import ccall "oci.h OCITransRollback" ociTransRollback :: ConnHandle -> ErrorHandle -> CInt -> IO CInt + +> foreign import ccall "oci.h OCIStmtPrepare" ociStmtPrepare :: StmtHandle -> ErrorHandle -> CString -> CInt -> CInt -> CInt -> IO CInt +> foreign import ccall "oci.h OCIDefineByPos" ociDefineByPos +> :: StmtHandle -> Ptr DefnHandle -> ErrorHandle -> CInt -> BufferPtr -> CInt -> CUShort -> Ptr CShort -> Ptr CUShort -> Ptr CUShort -> CInt -> IO CInt +> foreign import ccall "oci.h OCIStmtExecute" ociStmtExecute :: ConnHandle -> StmtHandle -> ErrorHandle -> CInt -> CInt -> OCIHandle -> OCIHandle -> CInt -> IO CInt +> foreign import ccall "oci.h OCIStmtFetch" ociStmtFetch :: StmtHandle -> ErrorHandle -> CInt -> CShort -> CInt -> IO CInt + +stmt, ptr bindHdl, err, pos, valuePtr, sizeOfValue, +datatype, indicatorPtr, lenArrayPtr, retCodeArrayPtr, +plsqlArrayMaxLen, plsqlCurrEltPtr, mode + +> foreign import ccall "oci.h OCIBindByPos" ociBindByPos :: +> StmtHandle -> Ptr BindHandle -> ErrorHandle -> CUInt -> BufferPtr -> CInt +> -> CUShort -> Ptr CShort -> Ptr CUShort -> Ptr CUShort +> -> CUInt -> Ptr CUInt -> CUInt -> IO CInt + +> foreign import ccall "oci.h OCIBindDynamic" ociBindDynamic :: +> BindHandle -> ErrorHandle -> ContextPtr -> FunPtr OCICallbackInBind +> -> ContextPtr -> FunPtr OCICallbackOutBind -> IO CInt + +> type OCICallbackInBind = ContextPtr -> BindHandle -> CInt -> CInt +> -> Ptr BufferPtr -> CInt -> Ptr Word8 -> Ptr CShort -> IO CInt + +> type OCICallbackOutBind = ContextPtr -> BindHandle -> CInt -> CInt +> -> Ptr BufferPtr -> Ptr CInt -> Ptr Word8 -> Ptr CShort -> Ptr (Ptr CShort) -> IO CInt + +> foreign import ccall "wrapper" mkOCICallbackInBind :: +> OCICallbackInBind -> IO (FunPtr OCICallbackInBind) +> foreign import ccall "wrapper" mkOCICallbackOutBind :: +> OCICallbackOutBind -> IO (FunPtr OCICallbackOutBind) + +--------------------------------------------------------------------------------- +-- ** OCI error reporting +--------------------------------------------------------------------------------- + +|This is just an auxiliary function for getOCIErrorMsg. + +> getOCIErrorMsg2 :: OCIHandle -> CInt -> Ptr CInt -> CString -> CInt -> IO (CInt, String) +> getOCIErrorMsg2 ocihandle handleType errCodePtr errMsgBuf maxErrMsgLen = do +> rc <- ociErrorGet ocihandle 1 nullPtr errCodePtr errMsgBuf maxErrMsgLen handleType +> if rc < 0 +> then return (0, "Error message not available.") +> else do +> msg <- peekCString errMsgBuf +> e <- peek errCodePtr +> return (e, msg) + + +> getOCIErrorMsg :: OCIHandle -> CInt -> IO (CInt, String) +> getOCIErrorMsg ocihandle handleType = do +> let stringBufferLen = 1000 +> allocaBytes stringBufferLen $ \errMsg -> +> alloca $ \errCode -> +> getOCIErrorMsg2 ocihandle handleType errCode errMsg (mkCInt stringBufferLen) + +> fromEnumOCIErrorCode :: CInt -> String +> fromEnumOCIErrorCode err +> | err == oci_SUCCESS = "OCI_SUCCESS" +> | err == oci_SUCCESS_WITH_INFO = "OCI_SUCCESS_WITH_INFO" +> | err == oci_NEED_DATA = "OCI_NEED_DATA" +> | err == oci_NO_DATA = "OCI_NO_DATA" +> | err == oci_INVALID_HANDLE = "OCI_INVALID_HANDLE" +> | err == oci_STILL_EXECUTING = "OCI_STILL_EXECUTING" +> | err == oci_CONTINUE = "OCI_CONTINUE" +> | err == oci_RESERVED_FOR_INT_USE = "OCI_RESERVED_FOR_INT_USE" +> | otherwise = "OCI_ERROR" + +> formatErrorCodeDesc :: CInt -> String -> String +> formatErrorCodeDesc err desc +> | err == oci_ERROR = "" +> | otherwise = (fromEnumOCIErrorCode err) ++ " - " ++ desc + + +|Given the two parts of an 'OCIException' (the error number and text) +get the actual error message from the DBMS and construct an error message +from all of these pieces. + +> formatOCIMsg :: CInt -> String -> OCIHandle -> CInt -> IO (Int, String) +> formatOCIMsg e m ocihandle handleType = do +> (err, msg) <- getOCIErrorMsg ocihandle handleType +> --return (fromIntegral err, (formatErrorCodeDesc e m) ++ " : " ++ (show err) ++ " - " ++ msg) +> if msg == "" +> then return (fromIntegral err, (formatErrorCodeDesc e m)) +> else return (fromIntegral err, (formatErrorCodeDesc e m) ++ " : " ++ msg) + + + +|We have two format functions: 'formatEnvMsg' takes the 'EnvHandle', +'formatErrorMsg' takes the 'ErrorHandle'. +They're just type-safe wrappers for 'formatMsgCommon'. + +> formatMsgCommon :: OCIException -> OCIHandle -> CInt -> IO (Int, String) +> formatMsgCommon (OCIException e m) h handleType = do +> if e == 0 +> then return (0, "") +> else case () of +> _ | e == oci_ERROR -> do (formatOCIMsg e m h handleType) +> | e == oci_SUCCESS_WITH_INFO -> do (formatOCIMsg e m h handleType) +> | otherwise -> return (fromIntegral e, formatErrorCodeDesc e m) + +> formatErrorMsg :: OCIException -> ErrorHandle -> IO (Int, String) +> formatErrorMsg exc err = formatMsgCommon exc (castPtr err) oci_HTYPE_ERROR + +> formatEnvMsg :: OCIException -> EnvHandle -> IO (Int, String) +> formatEnvMsg exc err = formatMsgCommon exc (castPtr err) oci_HTYPE_ENV + + + +|The testForError functions are the only places where OCIException is thrown, +so if you want to change or embellish it, your changes will be localised here. +These functions factor out common error handling code +from the OCI wrapper functions that follow. + +Typically an OCI wrapper function would look like: + + > handleAlloc handleType env = alloca ptr -> do + > rc <- ociHandleAlloc env ptr handleType 0 nullPtr + > if rc < 0 + > then throwOCI (OCIException rc msg) + > else return () + +where the code from @if rc < 0@ onwards was identical. +'testForError' replaces the code from @if rc < 0 ...@ onwards. + +> testForError :: CInt -> String -> a -> IO a +> testForError rc msg retval = do +> if rc < 0 +> then throwOCI (OCIException rc msg) +> else return retval + + +|Like 'testForError' but when the value you want to return +is at the end of a pointer. +Either there was an error, in which case the pointer probably isn't valid, +or there is something at the end of the pointer to return. +See 'dbLogon' and 'getHandleAttr' for example usage. + +> testForErrorWithPtr :: Storable a => CInt -> String -> Ptr a -> IO a +> testForErrorWithPtr rc msg retval = do +> if rc < 0 +> then throwOCI (OCIException rc msg) +> else peek retval + + +--------------------------------------------------------------------------------- +-- ** Allocating Handles (i.e. creating OCI data structures, and memory management) +--------------------------------------------------------------------------------- + + +> envCreate :: IO EnvHandle +> envCreate = alloca $ \ptr -> do +> rc <- ociEnvCreate ptr oci_DEFAULT nullPtr nullFunPtr nullFunPtr nullFunPtr 0 nullPtr +> testForErrorWithPtr rc "allocate initial end" ptr + +> handleAlloc :: CInt -> OCIHandle -> IO OCIHandle +> handleAlloc handleType env = alloca $ \ptr -> do +> rc <- ociHandleAlloc env ptr handleType 0 nullPtr +> testForErrorWithPtr rc "allocate handle" ptr + +> handleFree :: CInt -> OCIHandle -> IO () +> handleFree handleType ptr = do +> rc <- ociHandleFree ptr handleType +> testForError rc "free handle" () + + + +> setHandleAttr :: ErrorHandle -> OCIHandle -> CInt -> Ptr a -> CInt -> IO () +> setHandleAttr err ocihandle handleType handleAttr attrType = do +> rc <- ociAttrSet ocihandle handleType (castPtr handleAttr) 0 attrType err +> testForError rc "setHandleAttr" () + + +> setHandleAttrString :: ErrorHandle -> OCIHandle -> CInt -> String -> CInt -> IO () +> setHandleAttrString err ocihandle handleType s attrType = do +> withCStringLen s $ \sC -> do +> rc <- ociAttrSet ocihandle handleType (castPtr (cStr sC)) (cStrLen sC) attrType err +> testForError rc "setHandleAttrString" () + + +ociAttrGet returns a pointer to something - maybe a handle or a chunk of memory. +Sometimes it's a pointer to a Handle, i.e. a Ptr to a Ptr to a Struct, +so we want to peek it to get the Handle. +Other times it's a pointer to (say) a few bytes which might contain a number or a string. +Deref'ing it returns that value immediately, rather than a Ptr to that value. + +> getHandleAttr :: (Storable a) => ErrorHandle -> OCIHandle -> CInt -> CInt -> IO a +> getHandleAttr err ocihandle handleType attrType = alloca $ \ptr -> do +> -- 3rd arg has type Ptr OCIBuffer. +> rc <- ociAttrGet ocihandle handleType (castPtr ptr) nullPtr attrType err +> testForErrorWithPtr rc "getAttrHandle" ptr + +> getParam :: ErrorHandle -> StmtHandle -> Int -> IO ParamHandle +> getParam err stmt posn = alloca $ \ptr -> do +> rc <- ociParamGet (castPtr stmt) oci_HTYPE_STMT err ptr (mkCInt posn) +> testForErrorWithPtr rc "getParam" (castPtr ptr) + + +--------------------------------------------------------------------------------- +-- ** Connecting and detaching +--------------------------------------------------------------------------------- + +|The OCI Logon function doesn't behave as you'd expect when the password is due to expire. +'ociLogon' returns 'Database.Oracle.OCIConstants.oci_SUCCESS_WITH_INFO', +but the 'ConnHandle' returned is not valid. +In this case we have to change 'Database.Oracle.OCIConstants.oci_SUCCESS_WITH_INFO' +to 'Database.Oracle.OCIConstants.oci_ERROR', +so that the error handling code will catch it and abort. +I don't know why the handle returned isn't valid, +as the logon process should be able to complete successfully in this case. + + +> dbLogon :: String -> String -> String -> EnvHandle -> ErrorHandle -> IO ConnHandle +> dbLogon user pswd db env err = +> withCStringLen user $ \userC -> +> withCStringLen pswd $ \pswdC -> +> withCStringLen db $ \dbC -> +> alloca $ \conn -> do +> rc <- ociLogon env err conn (cStr userC) (cStrLen userC) (cStr pswdC) (cStrLen pswdC) (cStr dbC) (cStrLen dbC) +> case () of +> _ | rc == oci_SUCCESS_WITH_INFO -> testForErrorWithPtr oci_ERROR "logon" conn +> | otherwise -> testForErrorWithPtr rc "logon" conn + + +> dbLogoff :: ErrorHandle -> ConnHandle -> IO () +> dbLogoff err conn = do +> rc <- ociLogoff conn err +> testForError rc "logoff" () + + +> terminate :: IO () +> terminate = do +> rc <- ociTerminate oci_DEFAULT +> testForError rc "terminate" () + + + +> serverDetach :: ErrorHandle -> ServerHandle -> IO () +> serverDetach err server = do +> rc <- ociServerDetach server err oci_DEFAULT +> testForError rc "server detach" () + + +> serverAttach :: ErrorHandle -> ServerHandle -> String -> IO () +> serverAttach err server dblink = do +> withCStringLen dblink $ \s -> do +> rc <- ociServerAttach server err (cStr s) (cStrLen s) oci_DEFAULT +> testForError rc "server attach" () + + +|Having established a connection (Service Context), now get the Session. +You can have more than one session per connection, +but I haven't implemented it yet. + +> getSession :: ErrorHandle -> ConnHandle -> IO SessHandle +> getSession err conn = liftM castPtr (getHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX oci_ATTR_SESSION) + + +> sessionBegin :: ErrorHandle -> ConnHandle -> SessHandle -> CInt -> IO () +> sessionBegin err conn sess cred = do +> rc <- ociSessionBegin conn err sess cred oci_DEFAULT +> testForError rc "session begin" () + + +> sessionEnd :: ErrorHandle -> ConnHandle -> SessHandle -> IO () +> sessionEnd err conn sess = do +> rc <- ociSessionEnd conn err sess oci_DEFAULT +> testForError rc "session end" () + + + +--------------------------------------------------------------------------------- +-- ** Transactions +--------------------------------------------------------------------------------- + +> beginTrans :: ErrorHandle -> ConnHandle -> CInt -> IO () +> beginTrans err conn isolation = do +> rc <- ociTransStart conn err 0 isolation +> testForError rc "begin transaction" () + +> commitTrans :: ErrorHandle -> ConnHandle -> IO () +> commitTrans err conn = do +> rc <- ociTransCommit conn err oci_DEFAULT +> testForError rc "commit" () + +> rollbackTrans :: ErrorHandle -> ConnHandle -> IO () +> rollbackTrans err conn = do +> rc <- ociTransRollback conn err oci_DEFAULT +> testForError rc "rollback" () + + +--------------------------------------------------------------------------------- +-- ** Issuing queries +--------------------------------------------------------------------------------- + +|With the OCI you do queries with these steps: + + * prepare your statement (it's just a String) - no communication with DBMS + + * execute it (this sends it to the DBMS for parsing etc) + + * allocate result set buffers by calling 'defineByPos' for each column + + * call fetch for each row. + + * call 'handleFree' for the 'StmtHandle' + (I assume this is the approved way of terminating the query; + the OCI docs aren't explicit about this.) + + +> stmtPrepare :: ErrorHandle -> StmtHandle -> String -> IO () +> stmtPrepare err stmt sqltext = do +> withCStringLen sqltext $ \sqltextC -> do +> rc <- ociStmtPrepare stmt err (cStr sqltextC) (cStrLen sqltextC) oci_NTV_SYNTAX oci_DEFAULT +> testForError rc "stmtPrepare" () + + +> stmtExecute :: ErrorHandle -> ConnHandle -> StmtHandle -> Int -> IO () +> stmtExecute err conn stmt iterations = do +> rc <- ociStmtExecute conn stmt err (mkCInt iterations) 0 nullPtr nullPtr oci_DEFAULT +> testForError rc "stmtExecute" () + + + +|defineByPos allocates memory for a single column value. +The allocated components are: + + * the result (i.e. value) - you have to say how big with bufsize. + + * the null indicator (int16) + + * the size of the returned data (int16) + +Previously it was the caller's responsibility to free the memory after they're done with it. +Now we use 'Foreign.ForeignPtr.mallocForeignPtr', so manual memory management is hopefully +a thing of the past. +The caller will also have to cast the data in bufferptr to the expected type +(using 'Foreign.Ptr.castPtr'). + + +> defineByPos :: ErrorHandle +> -> StmtHandle +> -> Int -- ^ Position +> -> Int -- ^ Buffer size in bytes +> -> CInt -- ^ SQL Datatype (from "Database.Oracle.OCIConstants") +> -> IO ColumnInfo -- ^ tuple: (DefnHandle, Ptr to buffer, Ptr to null indicator, Ptr to size of value in buffer) +> defineByPos err stmt posn bufsize sqldatatype = do +> bufferFPtr <- mallocForeignPtrBytes bufsize +> nullIndFPtr <- mallocForeignPtr +> retSizeFPtr <- mallocForeignPtr +> alloca $ \defnPtr -> +> withForeignPtr bufferFPtr $ \bufferPtr -> +> withForeignPtr nullIndFPtr $ \nullIndPtr -> +> withForeignPtr retSizeFPtr $ \retSizePtr -> do +> rc <- ociDefineByPos stmt defnPtr err (mkCInt posn) bufferPtr (mkCInt bufsize) (mkCUShort sqldatatype) nullIndPtr retSizePtr nullPtr oci_DEFAULT +> defn <- peek defnPtr -- no need for caller to free defn; I think freeing the stmt handle does it. +> testForError rc "defineByPos" (defn, bufferFPtr, nullIndFPtr, retSizeFPtr) + + +|Oracle only understands bind variable placeholders using syntax :x, +where x is a number or a variable name. +Most other DBMS's use ? as a placeholder, +so we have this function to substitute ? with :n, +where n starts at one and increases with each ?. + +We don't use this function into this library though; +it's used in the higher-level implementation of Enumerator. +We prefer to retain flexibility at this lower-level, +and not force arbitrary implementation choices too soon. +If you want to use this library and use :x style syntax, you can. + +> substituteBindPlaceHolders sql = +> sbph sql 1 False "" + +> sbph :: String -> Int -> Bool -> String -> String +> sbph [] _ _ acc = reverse acc +> sbph ('\'':cs) i inQuote acc = sbph cs i (not inQuote) ('\'':acc) +> sbph ('?':cs) i False acc = sbph cs (i+1) False ((reverse (show i)) ++ (':':acc)) +> sbph (c:cs) i inQuote acc = sbph cs i inQuote (c:acc) + + + +> bindByPos :: +> ErrorHandle +> -> StmtHandle +> -> Int -- ^ Position +> -> CShort -- ^ Null ind: 0 == not null, -1 == null +> -> BufferPtr -- ^ payload +> -> Int -- ^ payload size in bytes +> -> CInt -- ^ SQL Datatype (from "Database.Oracle.OCIConstants") +> -> IO () +> bindByPos err stmt pos nullInd bufptr sze sqltype = do +> indFPtr <- mallocForeignPtr +> sizeFPtr <- mallocForeignPtr +> withForeignPtr indFPtr $ \p -> poke p nullInd +> -- You can't put any old junk in the return-size field, +> -- even if the parameter is IN-only. +> -- So tell it how big the input buffer is. +> withForeignPtr sizeFPtr $ \p -> poke p (fromIntegral sze) +> bufFPtr <- newForeignPtr_ bufptr +> bindOutputByPos err stmt pos (indFPtr, bufFPtr, sizeFPtr) sze sqltype +> return () + +Note that this function takes a ForeignPtr to the output-size +(in the triple) and also a size parameter, which is the input size. +We need to provide both, apparently, regardless of actual parameter +direction. + +> bindOutputByPos :: +> ErrorHandle +> -> StmtHandle +> -> Int -- ^ Position +> -> BindBuffer -- ^ triple of (null-ind, payload, output-size) +> -> Int -- ^ payload input size in bytes +> -> CInt -- ^ SQL Datatype (from "Database.Oracle.OCIConstants") +> -> IO BindHandle +> bindOutputByPos err stmt pos (nullIndFPtr, bufFPtr, sizeFPtr) sze sqltype = +> alloca $ \bindHdl -> +> withForeignPtr nullIndFPtr $ \indPtr -> do +> withForeignPtr sizeFPtr $ \sizePtr -> do +> withForeignPtr bufFPtr $ \bufPtr -> do +> rc <- ociBindByPos stmt bindHdl err (fromIntegral pos) bufPtr +> (fromIntegral sze) (fromIntegral sqltype) +> indPtr sizePtr nullPtr 0 nullPtr (fromIntegral oci_DEFAULT) +> testForError rc "bindOutputByPos" () +> bptr <- peek bindHdl +> return bptr + + +| Fetch a single row into the buffers. +If you have specified a prefetch count > 1 then the row +might already be cached by the OCI library. + +> stmtFetch :: ErrorHandle -> StmtHandle -> IO CInt +> stmtFetch err stmt = do +> let numRowsToFetch = 1 +> rc <- ociStmtFetch stmt err numRowsToFetch (mkCShort oci_FETCH_NEXT) oci_DEFAULT +> if rc == oci_NO_DATA +> then return rc +> else testForError rc "stmtFetch" rc + +From the "Bindind and Defining" chapter in the OCI docs: + +Binding RETURNING...INTO variables + +An OCI application implements the placeholders in the RETURNING clause +as pure OUT bind variables. However, all binds in the RETURNING clause +are initially IN and must be properly initialized. +To provide a valid value, you can provide a NULL indicator +and set that indicator to -1 (NULL). + +An application must adhere to the following rules when working with +bind variables in a RETURNING clause: + + 1. Bind RETURNING clause placeholders in OCI_DATA_AT_EXEC mode using + OCIBindByName() or OCIBindByPos(), followed by a call to + OCIBindDynamic() for each placeholder. + + Note: The OCI only supports the callback mechanism for + RETURNING clause binds. The polling mechanism is not supported. + + 2. When binding RETURNING clause placeholders, you must supply a valid out + bind function as the ocbfp parameter of the OCIBindDynamic() call. + This function must provide storage to hold the returned data. + + 3. The icbfp parameter of OCIBindDynamic() call should provide a + "dummy" function which returns NULL values when called. + + 4. The piecep parameter of OCIBindDynamic() must be set to OCI_ONE_PIECE. + + 5. No duplicate binds are allowed in a DML statement with a + RETURNING clause, such as no duplication between bind variables + in the DML section and the RETURNING section of the statement. + +|Short-circuit null test: if the buffer contains a null then return Nothing. +Otherwise, run the IO action to extract a value from the buffer and return Just it. + +> maybeBufferNull :: ForeignPtr CShort -> Maybe a -> IO a -> IO (Maybe a) +> maybeBufferNull nullIndFPtr nullVal action = +> withForeignPtr nullIndFPtr $ \nullIndPtr -> do +> nullInd <- liftM cShort2Int (peek nullIndPtr) +> if (nullInd == -1) -- -1 == null, 0 == value +> then return nullVal +> else do +> v <- action +> return (Just v) + + +> nullByte :: CChar +> nullByte = 0 + +> cShort2Int :: CShort -> Int +> cShort2Int n = fromIntegral n + +> cUShort2Int :: CUShort -> Int +> cUShort2Int n = fromIntegral n + +> cuCharToInt :: CUChar -> Int +> cuCharToInt c = fromIntegral c + +> byteToInt :: Ptr CUChar -> Int -> IO Int +> byteToInt buffer n = do +> b <- peekByteOff buffer n +> return (cuCharToInt b) + + +> bufferToString :: ColumnInfo -> IO (Maybe String) +> bufferToString (_, bufFPtr, nullFPtr, sizeFPtr) = +> withForeignPtr nullFPtr $ \nullIndPtr -> do +> nullInd <- liftM cShort2Int (peek nullIndPtr) +> if (nullInd == -1) -- -1 == null, 0 == value +> then return Nothing +> else do +> -- Given a column buffer, extract a string of variable length +> -- (you have to terminate it yourself). +> withForeignPtr bufFPtr $ \bufferPtr -> +> withForeignPtr sizeFPtr $ \retSizePtr -> do +> retsize <- liftM cUShort2Int (peek retSizePtr) +> pokeByteOff (castPtr bufferPtr) retsize nullByte +> val <- peekCString (castPtr bufferPtr) +> return (Just val) + + +| Oracle's excess-something-or-other encoding for years: +year = 100*(c - 100) + (y - 100), +c = (year div 100) + 100, +y = (year mod 100) + 100. + ++1999 -> 119, 199 ++0100 -> 101, 100 ++0001 -> 100, 101 +-0001 -> 100, 99 +-0100 -> 99, 100 +-1999 -> 81, 1 + +> makeYear :: Int -> Int -> Int +> makeYear c100 y100 = 100 * (c100 - 100) + (y100 - 100) + +> makeYearByte :: Int -> Word8 +> makeYearByte y = fromIntegral ((rem y 100) + 100) + +> makeCentByte :: Int -> Word8 +> makeCentByte y = fromIntegral ((quot y 100) + 100) + +> dumpBuffer :: Ptr Word8 -> IO () +> dumpBuffer buf = do +> dumpByte 0 +> dumpByte 1 +> dumpByte 2 +> dumpByte 3 +> dumpByte 4 +> dumpByte 5 +> dumpByte 6 +> putStrLn "" +> where +> dumpByte n = do +> b <- (peekByteOff buf n :: IO Word8) +> putStr $ (show b) ++ " " + + +> bufferToCaltime :: ForeignPtr CShort -> BufferFPtr -> IO (Maybe CalendarTime) +> bufferToCaltime nullind fptr = maybeBufferNull nullind Nothing $ +> withForeignPtr fptr $ \bufferPtr -> do +> let buffer = castPtr bufferPtr +> --dumpBuffer (castPtr buffer) +> century100 <- byteToInt buffer 0 +> year100 <- byteToInt buffer 1 +> month <- byteToInt buffer 2 +> day <- byteToInt buffer 3 +> hour <- byteToInt buffer 4 +> minute <- byteToInt buffer 5 +> second <- byteToInt buffer 6 +> return $ CalendarTime +> { ctYear = makeYear century100 year100 +> , ctMonth = toEnum (month - 1) +> , ctDay = day +> , ctHour = hour - 1 +> , ctMin = minute - 1 +> , ctSec = second - 1 +> , ctPicosec = 0 +> , ctWDay = Sunday +> , ctYDay = -1 +> , ctTZName = "UTC" +> , ctTZ = 0 +> , ctIsDST = False +> } + +> bufferToUTCTime :: ForeignPtr CShort -> BufferFPtr -> IO (Maybe UTCTime) +> bufferToUTCTime nullind fptr = maybeBufferNull nullind Nothing $ +> withForeignPtr fptr $ \bufferPtr -> do +> let buffer = castPtr bufferPtr +> --dumpBuffer (castPtr buffer) +> century100 <- byteToInt buffer 0 +> year100 <- byteToInt buffer 1 +> month <- byteToInt buffer 2 +> day <- byteToInt buffer 3 +> hour <- byteToInt buffer 4 +> minute <- byteToInt buffer 5 +> second <- byteToInt buffer 6 +> let year = makeYear century100 year100 +> return (mkUTCTime year month day (hour-1) (minute-1) (second-1)) + +> setBufferByte :: BufferPtr -> Int -> Word8 -> IO () +> setBufferByte buf n v = pokeByteOff buf n v + +> calTimeToBuffer :: BufferPtr -> CalendarTime -> IO () +> calTimeToBuffer buf ct = do +> setBufferByte buf 0 (makeCentByte (ctYear ct)) +> setBufferByte buf 1 (makeYearByte (ctYear ct)) +> setBufferByte buf 2 (fromIntegral ((fromEnum (ctMonth ct)) + 1)) +> setBufferByte buf 3 (fromIntegral (ctDay ct)) +> setBufferByte buf 4 (fromIntegral (ctHour ct + 1)) +> setBufferByte buf 5 (fromIntegral (ctMin ct + 1)) +> setBufferByte buf 6 (fromIntegral (ctSec ct + 1)) + +> utcTimeToBuffer :: BufferPtr -> UTCTime -> IO () +> utcTimeToBuffer buf utc = do +> let (LocalTime ltday time) = utcToLocalTime (hoursToTimeZone 0) utc +> let (TimeOfDay hour minute second) = time +> let (year, month, day) = toGregorian ltday +> setBufferByte buf 0 (makeCentByte (fromIntegral year)) +> setBufferByte buf 1 (makeYearByte (fromIntegral year)) +> setBufferByte buf 2 (fromIntegral month) +> setBufferByte buf 3 (fromIntegral day) +> setBufferByte buf 4 (fromIntegral (hour+1)) +> setBufferByte buf 5 (fromIntegral (minute+1)) +> setBufferByte buf 6 (round (second+1)) + + +> bufferPeekValue :: (Storable a) => BufferFPtr -> IO a +> bufferPeekValue buffer = do +> v <- withForeignPtr buffer $ \bufferPtr -> peek $ castPtr bufferPtr +> return v + +> bufferToA :: (Storable a) => ForeignPtr CShort -> BufferFPtr -> IO (Maybe a) +> bufferToA nullind buffer = maybeBufferNull nullind Nothing (bufferPeekValue buffer) + +> bufferToCInt :: ForeignPtr CShort -> BufferFPtr -> IO (Maybe CInt) +> bufferToCInt = bufferToA + +> bufferToInt :: ForeignPtr CShort -> BufferFPtr -> IO (Maybe Int) +> bufferToInt nullind b = do +> cint <- bufferToCInt nullind b +> return $ maybe Nothing (Just . fromIntegral) cint + +> bufferToCDouble :: ForeignPtr CShort -> BufferFPtr -> IO (Maybe CDouble) +> bufferToCDouble = bufferToA + +> bufferToDouble :: ForeignPtr CShort -> BufferFPtr -> IO (Maybe Double) +> bufferToDouble nullind b = do +> cdbl <- bufferToCDouble nullind b +> return $ maybe Nothing (Just . realToFrac) cdbl + +> bufferToStmtHandle :: BufferFPtr -> IO StmtHandle +> bufferToStmtHandle buffer = do +> withForeignPtr buffer $ \bufferPtr -> do +> v <- peek (castPtr bufferPtr) +> return v
+ Database/Oracle/Test/Enumerator.lhs view
@@ -0,0 +1,342 @@+ +| +Module : Database.Oracle.Test.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + + +The Oracle multi-result-set tests require these database objects: + +CREATE OR REPLACE VIEW t_whole as +select 0 as n from dual union select 1 from dual +union select 2 from dual union select 3 from dual +union select 4 from dual union select 5 from dual +union select 6 from dual union select 7 from dual +union select 8 from dual union select 9 from dual +; + +CREATE OR REPLACE VIEW t_natural as +select n from +( select t1.n + 10 * t10.n + 100 * t100.n as n +from t_whole t1, t_whole t10, t_whole t100 +) t where n > 0 order by 1 +; + +create or replace package Takusen as type RefCursor is ref cursor; end; + +CREATE OR REPLACE PROCEDURE takusenTestProc +(refc1 out Takusen.RefCursor, refc2 out Takusen.RefCursor) AS BEGIN +OPEN refc1 FOR SELECT n*n from t_natural where n < 10 order by 1; +OPEN refc2 FOR SELECT n, n*n, n*n*n from t_natural where n < 10 order by 1; +END; + +select n, cursor( + SELECT nat2.n + , cursor(SELECT nat3.n from t_natural nat3 where nat3.n < nat2.n order by n) + from t_natural nat2 where nat2.n < nat.n order by n +) +from t_natural nat where n < 10 order by n; + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Oracle.Test.Enumerator (runTest) where + +> import qualified Database.Oracle.Test.OCIFunctions as Low +> import Database.Oracle.Enumerator +> import Database.Util (print_) +> import Database.Test.Performance as Perf +> import Database.Test.Enumerator +> import Control.Monad (when) +> import Control.Exception (throwDyn) +> import Test.MiniUnit +> import Data.Int +> import System.Time + + +> runTest :: Perf.ShouldRunTests -> [String] -> IO () +> runTest runPerf args = do +> let (user:pswd:dbname:_) = args +> Low.runTest args +> flip catchDB basicDBExceptionReporter $ +> withSession (connect user pswd dbname) (testBody runPerf) + +> testBody runPerf = do +> runFixture OracleFunctions +> when (runPerf == Perf.RunTests) runPerformanceTests + +> runPerformanceTests = do +> makeFixture execDrop execDDL_ +> beginTransaction RepeatableRead +> runTestTT "Oracle performance tests" (map (flip catchDB reportRethrow) +> [ timedSelect (prefetch 1000 sqlRows2Power20 []) 30 (2^20) +> , timedSelect (prefetch 1 sqlRows2Power17 []) 60 (2^17) +> , timedSelect (prefetch 1000 sqlRows2Power17 []) 6 (2^17) +> , timedCursor (prefetch 1 sqlRows2Power17 []) 60 (2^17) +> , timedCursor (prefetch 1000 sqlRows2Power17 []) 6 (2^17) +> ] +> ) +> commit +> destroyFixture execDDL_ + + +> runFixture :: OracleFunctions -> DBM mark Session () +> runFixture fns = do +> makeFixture execDrop execDDL_ +> execDDL_ makeFixtureMultiResultSet1 +> execDDL_ makeFixtureMultiResultSet2 +> execDDL_ makeFixtureMultiResultSet3 +> execDDL_ makeFixtureMultiResultSet4 +> runTestTT "Oracle tests" (map (runOneTest fns) testList) +> execDDL_ dropFixtureMultiResultSet4 +> execDDL_ dropFixtureMultiResultSet3 +> execDDL_ dropFixtureMultiResultSet2 +> execDDL_ dropFixtureMultiResultSet1 +> destroyFixture execDDL_ + +> runOneTest fns t = catchDB (t fns) reportRethrow + +----------------------------------------------------------- + +> selectNoRows _ = selectTest sqlNoRows iterNoRows expectNoRows + +> selectTerminatesEarly _ = selectTest sqlTermEarly iterTermEarly expectTermEarly + +> selectFloatsAndInts fns = selectTest (sqlFloatsAndInts fns) iterFloatsAndInts expectFloatsAndInts + +> selectNullString _ = selectTest sqlNullString iterNullString expectNullString + +> selectEmptyString _ = selectTest sqlEmptyString iterEmptyString expectEmptyString + +> selectUnhandledNull _ = catchDB ( do +> selectTest sqlUnhandledNull iterUnhandledNull expectUnhandledNull +> assertFailure sqlUnhandledNull +> ) (\e -> return () ) + + + +> selectNullDate dateFn = selectTest (sqlNullDate dateFn) iterNullDate expectNullDate + +> selectDate dateFn = selectTest (sqlDate dateFn) iterDate expectDate + +> selectCalDate dateFn = selectTest (sqlDate dateFn) iterCalDate expectCalDate + +> selectBoundaryDates dateFn = selectTest (sqlBoundaryDates dateFn) iterBoundaryDates expectBoundaryDates + +> selectCursor fns = actionCursor (sqlCursor fns) + +> selectExhaustCursor fns = actionExhaustCursor (sqlCursor fns) + +> selectBindString _ = actionBindString +> (prepareQuery (sql sqlBindString)) +> [bindP "a2", bindP "b1"] + + +> selectBindInt _ = actionBindInt +> (prepareQuery (sql sqlBindInt)) +> [bindP (1::Int), bindP (2::Int)] + + +> selectBindIntDoubleString _ = actionBindIntDoubleString +> (prefetch 0 sqlBindIntDoubleString [bindP (1::Int), bindP (2.2::Double), bindP "row 1", bindP (3::Int), bindP (4.4::Double), bindP "row 2"]) + +> selectBindDate _ = actionBindDate +> (prefetch 1 sqlBindDate (map bindP expectBindDate)) + +> selectBindBoundaryDates _ = actionBindBoundaryDates +> (prefetch 1 sqlBindBoundaryDates (map bindP expectBoundaryDates)) + +> selectRebindStmt _ = actionRebind (prepareQuery (sql sqlRebind)) +> [bindP (1::Int)] [bindP (2::Int)] + +> boundStmtDML _ = actionBoundStmtDML (prepareCommand (sql sqlBoundStmtDML)) +> boundStmtDML2 _ = withTransaction RepeatableRead $ do +> count <- execDML (cmdbind sqlBoundStmtDML [bindP (100::Int), bindP "100"]) +> assertEqual sqlBoundStmtDML 1 count +> rollback + + +> polymorphicFetchTest _ = actionPolymorphicFetch +> (prefetch 0 sqlPolymorphicFetch [bindP expectPolymorphicFetch]) + +> polymorphicFetchTestNull _ = actionPolymorphicFetchNull +> (prefetch 1 sqlPolymorphicFetchNull []) + +> exceptionRollback _ = actionExceptionRollback sqlInsertTest4 sqlExceptionRollback + + + +> dropFixtureMultiResultSet1 = "DROP VIEW t_whole" +> makeFixtureMultiResultSet1 = "CREATE OR REPLACE VIEW t_whole as" +> ++ " select 0 as n from dual union select 1 from dual" +> ++ " union select 2 from dual union select 3 from dual" +> ++ " union select 4 from dual union select 5 from dual" +> ++ " union select 6 from dual union select 7 from dual" +> ++ " union select 8 from dual union select 9 from dual" + +> dropFixtureMultiResultSet2 = "DROP VIEW t_natural" +> makeFixtureMultiResultSet2 = "CREATE OR REPLACE VIEW t_natural as" +> ++ " select n from" +> ++ " ( select t1.n + 10 * t10.n + 100 * t100.n as n" +> ++ " from t_whole t1, t_whole t10, t_whole t100" +> ++ " ) t where n > 0 order by 1" + + +> dropFixtureMultiResultSet3 = "DROP package Takusen" +> makeFixtureMultiResultSet3 = +> "create or replace package Takusen as type RefCursor is ref cursor; end;" + +> dropFixtureMultiResultSet4 = "DROP PROCEDURE takusenTestProc" +> makeFixtureMultiResultSet4 = "CREATE OR REPLACE PROCEDURE takusenTestProc" +> ++ " (refc1 out Takusen.RefCursor, refc2 out Takusen.RefCursor) AS BEGIN" +> ++ " OPEN refc1 FOR SELECT n*n from t_natural where n < 10 order by 1;" +> ++ " OPEN refc2 FOR SELECT n, n*n, n*n*n from t_natural where n < 10 order by 1;" +> ++ " END;" + +What would you need to do to make database functions and procedures +callable from Haskell as if they were local functions (IO actions)? + +wrapPLSQLFunc funcname parms = + let + sqltext = "begin " ++ (head args) ++ " := " ++ funcname ++ "(" ++ placeholders ++ "); end;" + placeholders = concat (intersperse "," (tail args)) + args = take (length parms) (map (\n -> ":x" ++ show n) [1..]) + in cmdbind sqltext parms + +wrapPLSQLProc procname parms = + let + sqltext = "begin " ++ procname ++ "(" ++ placeholders ++ "); end;" + placeholders = concat (intersperse "," args) + args = take (length parms) (map (\n -> ":x" ++ show n) [1..]) + in cmdbind sqltext parms + +convertCcy :: String -> Double -> String -> UTCTime -> DBM mark Session (String, Double) +convertCcy ccyFrom valFrom ccyTo onDate = do + sqlcmd = wrapPLSQLProc "pk_fx.convert_ccy" + [ bindP (Out (0 :: Double)) + , bindP ccyFrom + , bindP valFrom + , bindP ccyTo + , bindP onDate + ] + let + iter :: Monad m => Double -> IterAct m Double + iter val seed = return (Left val) + result = doQuery sqlcmd iter undefined + return result + +> selectMultiResultSet _ = do +> let refcursor :: Maybe StmtHandle; refcursor = Just undefined +> withTransaction RepeatableRead $ do +> withPreparedStatement (prepareCommand (sql "begin takusenTestProc(:1,:2); end;")) $ \pstmt -> do +> withBoundStatement pstmt [bindP (Out refcursor), bindP (Out refcursor)] $ \bstmt -> do +> dummy <- doQuery bstmt iterMain () +> result1 <- doQuery (NextResultSet pstmt) iterRS1 [] +> assertEqual "selectMultiResultSet: RS1" [1,4,9,16,25,36,49,64,81] result1 +> result2 <- doQuery (NextResultSet pstmt) iterRS2 [] +> let expect = [(1,1,1),(2,4,8),(3,9,27),(4,16,64),(5,25,125),(6,36,216) +> ,(7,49,343),(8,64,512),(9,81,729)] +> assertEqual "selectMultiResultSet: RS2" expect result2 +> return () +> where +> iterMain :: (Monad m) => RefCursor StmtHandle -> RefCursor StmtHandle -> IterAct m () +> iterMain c1 c2 acc = return (Left acc) +> iterRS1 :: (Monad m) => Int -> IterAct m [Int] +> iterRS1 i acc = result (acc ++ [i]) +> iterRS2 :: (Monad m) => Int -> Int -> Int -> IterAct m [(Int, Int, Int)] +> iterRS2 i i2 i3 acc = result (acc ++ [(i, i2, i3)]) + + +> selectNestedMultiResultSet :: OracleFunctions -> DBM mark Session () +> selectNestedMultiResultSet _ = do +> let +> -- This returns two rows, each of which contains one cursor. +> -- The first cursor returns 101, the second 102. +> q = "select cursor(select n from dual) from" +> ++ " (select 101 as n from dual union select 102 from dual)" +> iterMain (c::RefCursor StmtHandle) acc = do +> rs <- doQuery c iterInner [] +> result' (c:acc) +> iterInner (i::Int) acc = do +> if (i /= 101 && i /= 102) +> then assertFailure "selectNestedMultiResultSet: inner value not 101 or 102" +> else return () +> result' (i:acc) +> withTransaction RepeatableRead $ do +> withPreparedStatement (prepareQuery (sql q)) $ \pstmt -> do +> withBoundStatement pstmt [] $ \bstmt -> do +> rs <- doQuery bstmt iterMain [] +> return () + + +> selectNestedMultiResultSet2 :: OracleFunctions -> DBM mark Session () +> selectNestedMultiResultSet2 _ = do +> let +> q = "select n, cursor(SELECT nat2.n, cursor" +> ++ " (SELECT nat3.n from t_natural nat3 where nat3.n < nat2.n order by n)" +> ++ " from t_natural nat2 where nat2.n < nat.n order by n)" +> ++ " from t_natural nat where n < 10 order by n" +> iterMain (outer::Int) (c::RefCursor StmtHandle) acc = do +> rs <- doQuery c (iterInner outer) [] +> let expect = drop (9-outer) [8,7,6,5,4,3,2,1] +> assertEqual "processOuter" expect (map fst rs) +> result' ((outer,c):acc) +> iterInner outer (inner::Int) (c::RefCursor StmtHandle) acc = do +> rs <- doQuery c (iterInner2 outer inner) [] +> let expect = drop (9-inner) [8,7,6,5,4,3,2,1] +> assertEqual "processInner" expect rs +> result' ((inner,c):acc) +> iterInner2 outer inner (i::Int) acc = do +> --print_ (show outer ++ " " ++ show inner ++ " " ++ show i) +> assertBool "processInner2" (i < inner) +> result' (i:acc) +> withTransaction RepeatableRead $ do +> withPreparedStatement (prepareQuery (sql q)) $ \pstmt -> do +> withBoundStatement pstmt [] $ \bstmt -> do +> rs <- doQuery bstmt iterMain [] +> assertEqual "selectNestedMultiResultSet" [9,8,7,6,5,4,3,2,1] (map fst rs) +> --print_ "" + +> selectNestedMultiResultSet3 :: OracleFunctions -> DBM mark Session () +> selectNestedMultiResultSet3 _ = do +> let +> q = "select n, cursor(SELECT nat2.n, cursor" +> ++ " (SELECT nat3.n from t_natural nat3 where nat3.n < nat2.n order by n)" +> ++ " from t_natural nat2 where nat2.n < nat.n order by n)" +> ++ " from t_natural nat where n < 10 order by n" +> iterMain (outer::Int) (c::RefCursor StmtHandle) acc = do +> rs <- doQuery c (iterInner outer) [] +> let expect = drop (9-outer) [8,7,6,5,4,3,2,1] +> assertEqual "processOuter" expect (map fst rs) +> result' ((outer,c):acc) +> iterInner outer (inner::Int) (c::RefCursor StmtHandle) acc = do +> rs <- doQuery c (iterInner2 outer inner) [] +> let expect = drop (9-inner) [8,7,6,5,4,3,2,1] +> assertEqual "processInner" expect rs +> result' ((inner,c):acc) +> iterInner2 outer inner (i::Int) acc = do +> --print_ (show outer ++ " " ++ show inner ++ " " ++ show i) +> assertBool "processInner2" (i < inner) +> result' (i:acc) +> withTransaction RepeatableRead $ do +> rs <- doQuery (sql q) iterMain [] +> assertEqual "selectNestedMultiResultSet" [9,8,7,6,5,4,3,2,1] (map fst rs) +> --print_ "" + +> testList :: [OracleFunctions -> DBM mark Session ()] +> testList = +> [ selectNoRows, selectTerminatesEarly, selectFloatsAndInts +> , selectNullString, selectEmptyString, selectUnhandledNull +> , selectNullDate, selectDate, selectCalDate, selectBoundaryDates +> , selectCursor, selectExhaustCursor +> , selectBindString, selectBindInt, selectBindIntDoubleString +> , selectBindDate, selectBindBoundaryDates, selectRebindStmt +> , boundStmtDML, boundStmtDML2 +> , polymorphicFetchTest, polymorphicFetchTestNull, exceptionRollback +> , selectMultiResultSet, selectNestedMultiResultSet +> , selectNestedMultiResultSet2, selectNestedMultiResultSet3 +> ]
+ Database/Oracle/Test/OCIFunctions.lhs view
@@ -0,0 +1,446 @@+ +| +Module : Database.Oracle.Test.OCIFunctions +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Test harness for "Database.Oracle.OCIFunctions". +This module depends on on "Database.Oracle.OCIFunctions". +so it should only use functions from there (and "Database.Oracle.OCIConstants"). + + +> {-# OPTIONS -fglasgow-exts #-} + +> module Database.Oracle.Test.OCIFunctions (runTest) where + +> import qualified Database.Oracle.OCIFunctions as OCI +> import Database.Oracle.OCIFunctions (EnvHandle, ErrorHandle, ConnHandle, StmtHandle) +> import Database.Oracle.OCIConstants +> import Foreign.Ptr +> import Foreign.C.String +> import Foreign.C.Types +> import Foreign +> import System.IO +> import System.Environment (getArgs) +> import Control.Monad +> import Test.MiniUnit +> import Data.Char + + +> nullAction :: IO () +> nullAction = return () + +> printError :: String -> IO () +> printError s = hPutStrLn stderr s + +> reportAndIgnore :: ErrorHandle -> OCI.OCIException -> IO () -> IO () +> reportAndIgnore err ociexc cleanupAction = do +> (e, m) <- OCI.formatErrorMsg ociexc err +> printError $ (show e) ++ ": " ++ m +> cleanupAction + +> reportAndRethrow :: ErrorHandle -> OCI.OCIException -> IO () -> IO () +> reportAndRethrow err ociexc cleanupAction = do +> (_, m) <- OCI.formatErrorMsg ociexc err +> printError m +> cleanupAction +> OCI.throwOCI ociexc + + +> logon :: (String, String, String) -> IO (EnvHandle, ErrorHandle, ConnHandle) +> logon (testUser, testPswd, testDb) = do +> env <- OCI.envCreate +> err <- OCI.handleAlloc oci_HTYPE_ERROR (castPtr env) +> OCI.catchOCI ( do +> server <- OCI.handleAlloc oci_HTYPE_SERVER (castPtr env) +> OCI.serverAttach (castPtr err) (castPtr server) testDb +> conn <- OCI.handleAlloc oci_HTYPE_SVCCTX (castPtr env) +> -- the connection holds a reference to the server in one of its attributes +> OCI.setHandleAttr (castPtr err) (castPtr conn) oci_HTYPE_SVCCTX (castPtr server) oci_ATTR_SERVER +> session <- OCI.handleAlloc oci_HTYPE_SESSION (castPtr env) +> if (testUser == "") +> then do +> OCI.sessionBegin (castPtr err) (castPtr conn) (castPtr session) oci_CRED_EXT +> else do +> OCI.setHandleAttrString (castPtr err) (castPtr session) oci_HTYPE_SESSION testUser oci_ATTR_USERNAME +> OCI.setHandleAttrString (castPtr err) (castPtr session) oci_HTYPE_SESSION testPswd oci_ATTR_PASSWORD +> OCI.sessionBegin (castPtr err) (castPtr conn) (castPtr session) oci_CRED_RDBMS +> -- the connection also holds a reference to the session in one of its attributes +> OCI.setHandleAttr (castPtr err) (castPtr conn) oci_HTYPE_SVCCTX (castPtr session) oci_ATTR_SESSION +> -- and we need to create a valid transaction handle for the connection, too. +> trans <- OCI.handleAlloc oci_HTYPE_TRANS (castPtr env) +> OCI.setHandleAttr (castPtr err) (castPtr conn) oci_HTYPE_SVCCTX (castPtr trans) oci_ATTR_TRANS +> return (env, castPtr err, castPtr conn) +> ) (\ociexc -> do +> reportAndIgnore (castPtr err) ociexc nullAction +> return (nullPtr, nullPtr, nullPtr) +> ) + +> logoff :: (EnvHandle, ErrorHandle, ConnHandle) -> IO () +> logoff (env, err, conn) = OCI.catchOCI ( do +> session <- OCI.getHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX oci_ATTR_SESSION +> server <- OCI.getHandleAttr err (castPtr conn) oci_HTYPE_SVCCTX oci_ATTR_SERVER +> OCI.sessionEnd err conn session +> OCI.serverDetach err server +> OCI.handleFree oci_HTYPE_SESSION (castPtr session) +> OCI.handleFree oci_HTYPE_SERVER (castPtr server) +> OCI.handleFree oci_HTYPE_SVCCTX (castPtr conn) +> OCI.handleFree oci_HTYPE_ERROR (castPtr err) +> OCI.handleFree oci_HTYPE_ENV (castPtr env) +> OCI.terminate +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) + + +> testCreateEnv :: IO () +> testCreateEnv = do +> env <- OCI.envCreate +> OCI.handleFree oci_HTYPE_ENV (castPtr env) + + +> testConnect :: (String, String, String) -> IO () +> testConnect args = do +> x <- logon args +> logoff x + + +> getStmt :: EnvHandle -> ErrorHandle -> ConnHandle -> String -> IO StmtHandle +> getStmt env err conn sql = do +> stmt <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> OCI.stmtPrepare err (castPtr stmt) sql +> OCI.stmtExecute err conn (castPtr stmt) 0 +> return (castPtr stmt) + + +> testBeginTrans :: (String, String, String) -> IO () +> testBeginTrans args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> OCI.beginTrans err conn oci_TRANS_SERIALIZABLE +> stmt <- getStmt env err conn "select dummy from dual" +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + + +> testExecute :: (String, String, String) -> IO () +> testExecute args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- getStmt env err conn "select dummy from dual" +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + + +> testFetch :: (String, String, String) -> IO () +> testFetch args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- getStmt env err conn "select dummy from dual" +> (_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt) 1 100 oci_SQLT_CHR +> rc <- OCI.stmtFetch err (castPtr stmt) +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + +> testFetchStmt :: (String, String, String) -> IO () +> testFetchStmt args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- getStmt env err conn "select cursor(select 101 from dual) from dual" +> (_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt) 1 8 oci_SQLT_RSET +> stmt2 <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> withForeignPtr buf $ \p -> poke (castPtr p) stmt2 +> rc <- OCI.stmtFetch err (castPtr stmt) +> -- stmt2 <- OCI.bufferToStmtHandle buf +> (_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt2) 1 4 oci_SQLT_INT +> rc <- OCI.stmtFetch err (castPtr stmt2) +> mb_i <- OCI.bufferToInt nullptr buf +> assertEqual "testFetchStmt" (Just 101) mb_i +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt2) +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + + +> testNestedFetchStmt :: (String, String, String) -> IO () +> testNestedFetchStmt args = do +> let +> -- This returns two rows, each of which contains one cursor. +> -- The first cursor returns 101, the second 102. +> sql = "select cursor(select n from dual) from" +> ++ " (select 101 as n from dual union select 102 from dual)" +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- getStmt env err conn sql +> -- Create result buffer bfor row 1 StmtHandle +> (_, obuf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt) 1 8 oci_SQLT_RSET +> stmt101 <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> withForeignPtr obuf $ \p -> poke (castPtr p) stmt101 +> -- +> -- Fetch row 1 of 2 +> rc <- OCI.stmtFetch err (castPtr stmt) +> -- +> -- Fetch stmt101 value +> (_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt101) 1 4 oci_SQLT_INT +> rc <- OCI.stmtFetch err (castPtr stmt101) +> mb_101 <- OCI.bufferToInt nullptr buf +> assertEqual "testFetchStmt" (Just 101) mb_101 +> --OCI.handleFree oci_HTYPE_STMT (castPtr stmt101) +> -- +> -- Create result buffer for row 2 StmtHandle... +> -- or re-use the StmtHandle stmt101. +> -- Both ways work. +> --(_, obuf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt) 1 8 oci_SQLT_RSET +> --stmt102 <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> --withForeignPtr obuf $ \p -> poke (castPtr p) stmt102 +> let stmt102 = stmt101 +> -- +> -- Fetch row 2 of 2 +> rc <- OCI.stmtFetch err (castPtr stmt) +> -- What happens if we free here? +> -- Will the child cursor still be valid? +> -- No - we get ORA-01001: invalid cursor +> -- So it looks like closing the parent closes the children too. +> --OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> -- +> -- Fetch stmt102 value +> (_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt102) 1 4 oci_SQLT_INT +> rc <- OCI.stmtFetch err (castPtr stmt102) +> mb_102 <- OCI.bufferToInt nullptr buf +> assertEqual "testFetchStmt" (Just 102) mb_102 +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt102) +> -- +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + + + +> testFetchFail :: (String, String, String) -> IO () +> testFetchFail args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- getStmt env err conn "select dummy, 1 from dual" +> (_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt) 1 100 oci_SQLT_CHR +> rc <- OCI.stmtFetch err (castPtr stmt) +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + + +> testBind :: (String, String, String) -> IO () +> testBind args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> -- Oracle can't cope with ? as a bind variable placeholder. +> -- We must use the :x style instead. +> -- Sqlite can cope with either. I think the ANSI/ISO standard is :n. +> OCI.stmtPrepare err (castPtr stmt) +> (OCI.substituteBindPlaceHolders "select :1 from dual union select :2 from dual") +> withCStringLen "hello" $ \(cstr, clen) -> +> OCI.bindByPos err (castPtr stmt) 1 0 (castPtr cstr) clen oci_SQLT_CHR +> withCStringLen "hello2" $ \(cstr, clen) -> +> OCI.bindByPos err (castPtr stmt) 2 0 (castPtr cstr) clen oci_SQLT_CHR +> OCI.stmtExecute err conn (castPtr stmt) 0 +> buffer@(_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt) 1 100 oci_SQLT_CHR +> rc <- OCI.stmtFetch err (castPtr stmt) +> s <- OCI.bufferToString buffer +> rc <- OCI.stmtFetch err (castPtr stmt) +> s <- OCI.bufferToString buffer +> rc <- OCI.stmtFetch err (castPtr stmt) +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + +> testOutputBind :: (String, String, String) -> IO () +> testOutputBind args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> -- Oracle can't cope with ? as a bind variable placeholder. +> -- We must use the :x style instead. +> -- Sqlite can cope with either. I think the ANSI/ISO standard is :n. +> OCI.stmtPrepare err (castPtr stmt) (OCI.substituteBindPlaceHolders +> ("begin if :1 <> 'hello' then " +> ++ "raise_application_error(-20001, 'xx-' || :1 || '-xx'); end if; " +> ++ ":1 := 'abcdefghijk'; :2 := 1026; end;")) +> nullIndFPtr1 <- mallocForeignPtr +> nullIndFPtr2 <- mallocForeignPtr +> sizeFPtr1 <- mallocForeignPtr +> sizeFPtr2 <- mallocForeignPtr +> cintFPtr <- mallocForeignPtrBytes (sizeOf (0::CInt)) +> cstrFPtr <- mallocForeignPtrBytes 16000 +> withForeignPtr cstrFPtr $ \p -> +> withCStringLen "hello" $ \(cstr, clen) -> copyBytes p (castPtr cstr) (clen+1) +> withForeignPtr sizeFPtr1 $ \p -> poke p 5 +> withForeignPtr sizeFPtr2 $ \p -> poke p (fromIntegral (sizeOf (0::CInt))) +> OCI.bindOutputByPos err (castPtr stmt) 1 (nullIndFPtr1, castForeignPtr cstrFPtr, sizeFPtr1) 16000 oci_SQLT_CHR +> OCI.bindOutputByPos err (castPtr stmt) 2 (nullIndFPtr2, castForeignPtr cintFPtr, sizeFPtr2) (sizeOf (0::CInt)) oci_SQLT_INT +> OCI.stmtExecute err conn (castPtr stmt) 1 +> s <- withForeignPtr cstrFPtr (peekCString . castPtr) +> assertEqual "testOutputBind: 1" "abcdefghijk" s +> ind <- withForeignPtr nullIndFPtr1 peek +> assertEqual "testOutputBind: 2" 0 ind +> i <- withForeignPtr cintFPtr peek +> assertEqual "testOutputBind: 3" 1026 (i :: CInt) +> size <- withForeignPtr sizeFPtr1 peek >>= return . fromIntegral +> assertEqual "testOutputBind: 4" 11 size +> size <- withForeignPtr sizeFPtr2 peek >>= return . fromIntegral +> assertEqual "testOutputBind: 5" (sizeOf (0::CInt)) size +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + +> testOutputBindNoStrings :: (String, String, String) -> IO () +> testOutputBindNoStrings args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> OCI.stmtPrepare err (castPtr stmt) (OCI.substituteBindPlaceHolders +> ("begin if :1 <> 2 then " +> ++ "raise_application_error(-20001, 'xx-' || to_char(:1) || '-xx'); end if; " +> ++ ":1 := 130; :2 := 1026; end;")) +> let sizeOfCInt = sizeOf (0::CInt) +> nullIndFPtr1 <- mallocForeignPtr +> nullIndFPtr2 <- mallocForeignPtr +> sizeFPtr1 <- mallocForeignPtr +> sizeFPtr2 <- mallocForeignPtr +> cintFPtr1 <- mallocForeignPtrBytes sizeOfCInt +> cintFPtr2 <- mallocForeignPtrBytes sizeOfCInt +> withForeignPtr cintFPtr1 $ \p -> poke p 2 +> withForeignPtr cintFPtr2 $ \p -> poke p 3 +> withForeignPtr sizeFPtr1 $ \p -> poke p (fromIntegral sizeOfCInt) +> withForeignPtr sizeFPtr2 $ \p -> poke p (fromIntegral sizeOfCInt) +> OCI.bindOutputByPos err (castPtr stmt) 1 (nullIndFPtr1, castForeignPtr cintFPtr1, sizeFPtr1) sizeOfCInt oci_SQLT_INT +> OCI.bindOutputByPos err (castPtr stmt) 2 (nullIndFPtr2, castForeignPtr cintFPtr2, sizeFPtr2) sizeOfCInt oci_SQLT_INT +> OCI.stmtExecute err conn (castPtr stmt) 1 +> ind <- withForeignPtr nullIndFPtr1 peek +> assertEqual "testOutputBind: 0" 0 ind +> i <- withForeignPtr cintFPtr1 peek +> assertEqual "testOutputBind: 1" 130 (i :: CInt) +> ind <- withForeignPtr nullIndFPtr2 peek +> assertEqual "testOutputBind: 2" 0 ind +> i <- withForeignPtr cintFPtr2 peek +> assertEqual "testOutputBind: 3" 1026 (i :: CInt) +> size <- withForeignPtr sizeFPtr1 peek >>= return . fromIntegral +> assertEqual "testOutputBind: 4" sizeOfCInt size +> size <- withForeignPtr sizeFPtr2 peek >>= return . fromIntegral +> assertEqual "testOutputBind: 5" sizeOfCInt size +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + +> testOutputStmtBind :: (String, String, String) -> IO () +> testOutputStmtBind args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> OCI.stmtPrepare err (castPtr stmt) (OCI.substituteBindPlaceHolders +> ("begin open :1 for select dummy from dual; end;")) +> nullIndFPtr <- mallocForeignPtr +> sizeFPtr <- mallocForeignPtr +> bufrFPtr <- mallocForeignPtrBytes (sizeOf nullPtr) +> -- you have to pass in a valid Statement Handle +> -- is it replaced or just modified? +> stmtx <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> withForeignPtr bufrFPtr $ \p -> poke p (castPtr stmtx) +> withForeignPtr sizeFPtr $ \p -> poke p (fromIntegral (sizeOf nullPtr)) +> OCI.bindOutputByPos err (castPtr stmt) 1 (nullIndFPtr, castForeignPtr bufrFPtr, sizeFPtr) (sizeOf nullPtr) oci_SQLT_RSET +> OCI.stmtExecute err conn (castPtr stmt) 1 +> ind <- withForeignPtr nullIndFPtr $ \p -> peek p +> assertEqual "testOutputStmtBind: ind" 0 ind +> --stmt2 <- withForeignPtr bufrFPtr (peek . castPtr) +> let stmt2 = stmtx +> buffer@(_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt2) 1 100 oci_SQLT_CHR +> rc <- OCI.stmtFetch err (castPtr stmt2) +> s <- OCI.bufferToString buffer +> assertEqual "testOutputStmtBind: stmt2 dummy" (Just "X") s +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt2) +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + + +This just shows that the parent StmtHandle can be safely +closed before we fetch from the child, and this doesn't +seem to matter. +This only works for PL/SQL statements that have output bind variables. +For select statements that return cursors, closing the parent +statement closes all the child cursors too. + +> testOutputStmtBindCloseEarly :: (String, String, String) -> IO () +> testOutputStmtBindCloseEarly args = do +> (env, err, conn) <- logon args +> OCI.catchOCI ( do +> stmt <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> OCI.stmtPrepare err (castPtr stmt) (OCI.substituteBindPlaceHolders +> ("begin open :1 for select 'A' from dual; end;")) +> nullIndFPtr <- mallocForeignPtr +> sizeFPtr <- mallocForeignPtr +> bufrFPtr <- mallocForeignPtrBytes (sizeOf nullPtr) +> -- you have to pass in a valid Statement Handle +> -- is it replaced or just modified? +> stmtx <- OCI.handleAlloc oci_HTYPE_STMT (castPtr env) +> withForeignPtr bufrFPtr $ \p -> poke p (castPtr stmtx) +> withForeignPtr sizeFPtr $ \p -> poke p (fromIntegral (sizeOf nullPtr)) +> OCI.bindOutputByPos err (castPtr stmt) 1 (nullIndFPtr, castForeignPtr bufrFPtr, sizeFPtr) (sizeOf nullPtr) oci_SQLT_RSET +> OCI.stmtExecute err conn (castPtr stmt) 1 +> ind <- withForeignPtr nullIndFPtr $ \p -> peek p +> assertEqual "testOutputStmtBindCloseEarly: ind" 0 ind +> --stmt2 <- withForeignPtr bufrFPtr (peek . castPtr) +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt) +> let stmt2 = stmtx +> buffer@(_, buf, nullptr, sizeptr) <- OCI.defineByPos err (castPtr stmt2) 1 100 oci_SQLT_CHR +> rc <- OCI.stmtFetch err (castPtr stmt2) +> s <- OCI.bufferToString buffer +> assertEqual "testOutputStmtBindCloseEarly: stmt2 dummy" (Just "A") s +> OCI.handleFree oci_HTYPE_STMT (castPtr stmt2) +> ) (\ociexc -> reportAndIgnore (castPtr err) ociexc nullAction) +> logoff (env, err, conn) + +> testSubst input expect = do +> let actual = OCI.substituteBindPlaceHolders input +> when (actual /= expect) (error $ "testSubstBindPlaceHolders failed: " ++ input ++ " -> " ++ actual) + +> testSubstituteBindPlaceHolders :: IO () +> testSubstituteBindPlaceHolders = do +> testSubst "?'?'?" ":1'?':2" +> testSubst "?" ":1" +> testSubst "" "" +> testSubst "x" "x" +> testSubst "????????????" ":1:2:3:4:5:6:7:8:9:10:11:12" +> testSubst "?'''?'''''?" ":1'''?''''':2" + + +> parseArgs :: [String] -> IO (String, String, String) +> parseArgs args = do +> let [u, p, d] = args +> return (u, p, d) + +> testlist args = +> [ testCreateEnv +> , testConnect args +> , testBeginTrans args +> , testExecute args +> , testFetch args +> , testFetchFail args +> , testFetchStmt args +> , testNestedFetchStmt args +> , testBind args +> , testOutputBind args +> , testOutputBindNoStrings args +> , testOutputStmtBind args +> , testOutputStmtBindCloseEarly args +> , testSubstituteBindPlaceHolders +> ] + +> runTest :: [String] -> IO () +> runTest as = do +> args <- parseArgs as +> counts <- runTestTT "Oracle low-level tests" (testlist args) +> return ()
+ Database/PostgreSQL/Enumerator.lhs view
@@ -0,0 +1,628 @@+ +| +Module : Database.PostgreSQL.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +PostgreSQL implementation of Database.Enumerator. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-undecidable-instances #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.PostgreSQL.Enumerator +> ( Session, connect, ConnectAttr(..) +> , prepareStmt, preparePrefetch +> , prepareQuery, prepareLargeQuery, prepareCommand +> , sql, sqlbind, prefetch, cmdbind +> , bindType +> , module Database.Enumerator +> ) +> where + + +> import Database.Enumerator +> import Database.InternalEnumerator +> import Foreign.C +> import Control.Monad +> import Control.Exception (catchDyn, throwDyn, throwIO) +> import qualified Database.PostgreSQL.PGFunctions as DBAPI +> import Data.Char +> import Data.Dynamic +> import Data.IORef +> import Data.Int +> import Data.List +> import Data.Time +> import System.Time + +> {-# DEPRECATED prepareStmt "Use prepareQuery or prepareCommand instead" #-} +> {-# DEPRECATED preparePrefetch "Use prepareLargeQuery instead" #-} + +-------------------------------------------------------------------- +-- ** API Wrappers +-------------------------------------------------------------------- + +|These wrappers ensure that only DBExceptions are thrown, +and never PGExceptions. +We don't need wrappers for the colValXxx functions +because they never throw exceptions. + + +> convertAndRethrow :: DBAPI.PGException -> IO a +> convertAndRethrow (DBAPI.PGException e m) = do +> let +> sqlstate@(ssc,sssc) = errorSqlState m +> errorConstructor = case ssc of +> "XX" -> DBFatal +> "58" -> DBFatal +> "57" -> DBFatal +> "54" -> DBFatal +> "53" -> DBFatal +> "08" -> DBFatal +> _ -> DBError +> throwDB (errorConstructor sqlstate e m) + +Postgres error messages (in Verbose mode) start with +ERROR: 42P01: relation "blahblahblah" does not exist. + +> errorSqlState :: String -> (String, String) +> errorSqlState msg = let s = dropPrefix "ERROR: " msg in (take 2 s, take 3 (drop 2 s)) + +> dropPrefix p s = if isPrefixOf p s then drop (length p) s else s + +|Common case: wrap an action with a convertAndRethrow. + +> convertEx :: IO a -> IO a +> convertEx action = DBAPI.catchPG action convertAndRethrow + + +-------------------------------------------------------------------- +-- ** Sessions +-------------------------------------------------------------------- + +We don't need much in an PostgreSQL Session record. +Session objects are created by 'connect'. +Deriving Typeable allows us to store Session objects in a +HashMap (say) of Dynamic objects e.g. for a connection pool. + +> newtype Session = Session { dbHandle :: DBAPI.DBHandle } +> deriving Typeable + +| Specify connection options to 'connect'. +You only need to use whatever subset is relevant for your connection. + +> data ConnectAttr = +> CAhost String +> | CAhostaddr String +> | CAport String +> | CAdbname String +> | CAuser String +> | CApassword String +> | CAconnect_timeout Int +> | CAoptions String +> | CAsslmode String +> | CAservice String +> +> connect :: [ConnectAttr] -> ConnectA Session +> connect attrs = ConnectA $ convertEx $ do +> db <- DBAPI.openDb (unwords $ map encode attrs) +> DBAPI.disableNoticeReporting db +> -- Use Verbose to return the SqlState in the error message. +> -- There doesn't seem to be a libpq API function to get it... +> DBAPI.setErrorVerbosity db DBAPI.ePQERRORS_VERBOSE +> --DBAPI.setErrorVerbosity db DBAPI.ePQERRORS_DEFAULT +> --DBAPI.setErrorVerbosity db DBAPI.ePQERRORS_TERSE +> return (Session db) +> where +> -- process attributes into a string name=value +> encode (CAhost s) = "host=" ++ enc s +> encode (CAhostaddr s) = "hostaddr=" ++ enc s +> encode (CAport s) = "port=" ++ enc s +> encode (CAdbname s) = "dbname=" ++ enc s +> encode (CAuser s) = "user=" ++ enc s +> encode (CApassword s) = "password=" ++ enc s +> encode (CAconnect_timeout i) = "connect_timeout=" ++ show i +> encode (CAoptions s) = "options=" ++ enc s +> encode (CAsslmode s) = "sslmode=" ++ enc s +> encode (CAservice s) = "service=" ++ enc s +> enc s = "'" ++ qu s ++ "'" +> qu s = case break ( \c -> c == '\'' || c == '"' ) s of +> (s,"") -> s +> (s,(c:t)) -> s ++ ('\\' : c : qu t) + + +> isolationLevelText ReadUncommitted = "read uncommitted" +> isolationLevelText ReadCommitted = "read committed" +> isolationLevelText RepeatableRead = "repeatable read" +> isolationLevelText Serialisable = "serializable" +> isolationLevelText Serializable = "serializable" + + +> instance ISession Session where +> disconnect sess = convertEx $ DBAPI.closeDb (dbHandle sess) +> beginTransaction sess isolation = do +> executeCommand sess (sql ("begin isolation level " ++ isolationLevelText isolation)) >> return () +> commit sess = executeCommand sess (sql "commit") >> return () +> rollback sess = executeCommand sess (sql "rollback") >> return () + + +-------------------------------------------------------------------- +-- Statements and Commands +-------------------------------------------------------------------- + + +> newtype QueryString = QueryString String + +|The simplest kind of a statement: no tuning parameters, +all default, little overhead. + +> sql :: String -> QueryString +> sql str = QueryString str + +> instance Command QueryString Session where +> executeCommand s (QueryString str) = executeCommand s str + +> instance Command String Session where +> executeCommand s str = do +> (_,ntuple_str,_) <- convertEx $ DBAPI.nqExec (dbHandle s) str +> return $ if ntuple_str == "" then 0 else read ntuple_str + +> instance Command BoundStmt Session where +> executeCommand s bs = return (boundCount bs) + +> data CommandBind = CommandBind String [BindA Session PreparedStmtObj BindObj] + +> cmdbind :: String -> [BindA Session PreparedStmtObj BindObj] -> CommandBind +> cmdbind sql parms = CommandBind sql parms + +> instance Command CommandBind Session where +> executeCommand sess (CommandBind sqltext bas) = do +> -- tricky - can't prepare statement without list of bind types, +> -- but to construct list of bind types we need to evaluate the bind +> -- actions and then get the bind-type out of the resulting PGBindVal object. +> -- The bind action normally requires a valid session and stmt, +> -- so we have a chicken-and-egg problem. +> -- Good thing the sess and stmt that we pass to the bind action are +> -- not used (see makeBindAction below), so we can pass undefined. +> let params = map (\(BindA ba) -> ba sess undefined) bas +> let bindtypes = DBAPI.bindTypes params +> let (PreparationA pa) = prepareCommand "" (QueryString sqltext) bindtypes +> pstmt <- pa sess +> writeIORef (stmtCursors pstmt) [] +> (_, countstr, _) <- convertEx $ DBAPI.execPreparedCommand (dbHandle sess) (stmtName pstmt) params +> return (read countstr) + + +|At present the only resource tuning we support is the number of rows +prefetched by the FFI library. +We use a record to (hopefully) make it easy to add other +tuning parameters later. + +> data QueryResourceUsage = QueryResourceUsage { prefetchRowCount :: Int } + +> defaultResourceUsage :: QueryResourceUsage +> defaultResourceUsage = QueryResourceUsage 0 -- get it all at once + + +> data StmtType = SelectType | CommandType + +Simple prepared statement: the analogue of QueryString. It is useful +for DDL and DML statements, and for simple queries (that is, queries +that do not need cursors and result in a small enough dataset -- because +it will be fetched entirely in one shot). + +The data constructor is not exported. + +> data PreparedStmtObj = PreparedStmtObj +> { stmtName :: String +> , stmtType :: StmtType +> , stmtPrefetch :: Int +> , stmtCursors :: IORef [RefCursor String] +> } + +> beginsWithSelect "" = False +> beginsWithSelect text = isPrefixOf "select" . map toLower $ text +> inferStmtType text = if beginsWithSelect text then SelectType else CommandType + +> prepareStmt :: +> String -> QueryString -> [DBAPI.Oid] -> PreparationA Session PreparedStmtObj +> prepareStmt [] _ _ = error "Prepared statement name must be non-empty" +> prepareStmt name (QueryString str) types = +> PreparationA (\sess -> do +> psname <- convertEx $ DBAPI.stmtPrepare (dbHandle sess) name (DBAPI.substituteBindPlaceHolders str) types +> c <- newIORef [] +> return (PreparedStmtObj psname (inferStmtType str) 0 c) +> ) + +> prepareQuery :: +> String -> QueryString -> [DBAPI.Oid] -> PreparationA Session PreparedStmtObj +> prepareQuery name (QueryString str) types = +> PreparationA (\sess -> do +> psname <- convertEx $ DBAPI.stmtPrepare (dbHandle sess) name (DBAPI.substituteBindPlaceHolders str) types +> c <- newIORef [] +> return (PreparedStmtObj psname SelectType 0 c) +> ) + +Here we use the same name for both the cursor name and the prepared statement name. +This isn't necessary, but it saves the user having to provide two names... + +> preparePrefetch :: +> Int -> String -> QueryString -> [DBAPI.Oid] -> PreparationA Session PreparedStmtObj +> preparePrefetch count name (QueryString sqltext) types = +> PreparationA (\sess -> do +> let q = "DECLARE \"" ++ name ++ "\" NO SCROLL CURSOR FOR " ++ sqltext +> psname <- convertEx $ DBAPI.stmtPrepare (dbHandle sess) name (DBAPI.substituteBindPlaceHolders q) types +> c <- newIORef [] +> return (PreparedStmtObj psname CommandType count c) +> ) + +> prepareLargeQuery :: +> Int -> String -> QueryString -> [DBAPI.Oid] -> PreparationA Session PreparedStmtObj +> prepareLargeQuery = preparePrefetch + +> prepareCommand :: +> String -> QueryString -> [DBAPI.Oid] -> PreparationA Session PreparedStmtObj +> prepareCommand name (QueryString sqltext) types = +> PreparationA (\sess -> do +> psname <- convertEx $ DBAPI.stmtPrepare (dbHandle sess) name (DBAPI.substituteBindPlaceHolders sqltext) types +> c <- newIORef [] +> return (PreparedStmtObj psname CommandType 0 c) +> ) + + +|bindType is useful when constructing the list of Oids for stmtPrepare. +You don't need to pass the actual bind values, just dummy values +of the same type (the value isn't used, so 'Prelude.undefined' is OK here). + +> bindType :: DBAPI.PGType a => a -> DBAPI.Oid +> bindType v = DBAPI.pgTypeOid v + +We store the parent prepared-statement in BoundStmt. +This is used by the BoundStmt instance of Statement to set up +the parent PreparedStmtObj object in the Query object. + +Note two different types of BoundStmt (prefetch and non-prefetch). +The prefetch version requires different behaviour both when +binding-and-running (it doesn't return a result-set, so we have to +execute it as a command), and when processing the result-set +(the non-prefetch version has all of the data available, +whereas the prefetch version must use the advance+cleanup actions). + +> data BoundStmt = +> BoundStmtQuery +> { boundHandle :: DBAPI.ResultSetHandle +> , boundCount :: Int +> , boundParentStmt :: PreparedStmtObj +> } +> | BoundStmtCommand +> { boundParentStmt :: PreparedStmtObj +> , boundCount :: Int +> } + + +The bindRun method returns a BoundStmt, +which contains just the result-set (and row count). + +> type BindObj = DBAPI.PGBindVal + +> instance IPrepared PreparedStmtObj Session BoundStmt BindObj where +> bindRun sess stmt bas action = do +> let params = map (\(BindA ba) -> ba sess stmt) bas +> writeIORef (stmtCursors stmt) [] +> case stmtType stmt of +> CommandType -> do +> (_, countstr, _) <- convertEx $ DBAPI.execPreparedCommand (dbHandle sess) (stmtName stmt) params +> action (BoundStmtCommand stmt (read countstr)) +> SelectType -> do +> (rs, count) <- convertEx $ DBAPI.stmtExec (dbHandle sess) (stmtName stmt) params +> action (BoundStmtQuery rs count stmt) +> destroyStmt sess stmt = deallocateStmt sess (stmtName stmt) + +> deallocateStmt sess name = +> when (not (null name)) $ do +> executeCommand sess ("deallocate \"" ++ name ++ "\"") +> return () + +-- Serialization (binding) + +> makeBindAction x = BindA (\_ _ -> DBAPI.newBindVal x) + +> instance DBBind (Maybe String) Session PreparedStmtObj BindObj where +> bindP (Just s) = makeBindAction (Just s) +> bindP Nothing = makeBindAction (Nothing `asTypeOf` Just "") + +> instance DBBind (Maybe UTCTime) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe Int) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe Int64) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe Float) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe Double) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe a) Session PreparedStmtObj BindObj +> => DBBind a Session PreparedStmtObj BindObj where +> bindP x = bindP (Just x) + +The default instance, uses generic Show + +> instance (Show a) => DBBind (Maybe a) Session PreparedStmtObj BindObj where +> bindP (Just x) = bindP (Just (show x)) +> bindP Nothing = bindP (Nothing `asTypeOf` Just "") + +-------------------------------------------------------------------- +-- ** Queries +-------------------------------------------------------------------- + +> data SubQuery = SubQuery +> { stmtHandle :: DBAPI.ResultSetHandle +> , ntuples :: Int -- number of tuples to process in this subquery +> , curr'row :: Int -- current row, one-based. Should increment before use +> } + + +> data Query = Query +> { subquery :: IORef SubQuery +> , advance'action :: Maybe (IO (DBAPI.ResultSetHandle, Int)) +> , cleanup'action :: Maybe (IO ()) +> , querySession :: Session +> , queryStmt :: Maybe PreparedStmtObj +> } + + + +The following function creates the Query record. It has a few +decisions to make: + -- should we prepare a statement or do execImm? + -- should we use a cursor (better for large queries) or obtain + all data in one shot? + The use of cursor means we must be in a transaction. + -- what is the name of the prepared statement? + Potentially, we should be able to execute a previously prepared + statement... + +Currently, if prefetchRowCount is 0 or the query is +not tuned, we use execImm. Otherwise, +we open a cursor and advance it by prefetchRowCount step. +We use anonymous prepared statement name. + +The function commence'query also fetches some data (even if it turns +out 0 rows) so that later on, we could determine the type of data in columns +and prepare the buffers accordingly. We don't do that at the moment. + + +> instance Statement String Session Query where +> makeQuery sess sqltext = makeQuery sess (QueryString sqltext) + +> instance Statement QueryString Session Query where +> makeQuery sess (QueryString sqltext) = commence'query'simple sess sqltext [] + + +Simple prepared statements. +Query has been executed and result-set is in handle. + +> instance Statement BoundStmt Session Query where +> makeQuery sess bs@(BoundStmtQuery _ _ _) = do +> sqr <- newIORef $ SubQuery (boundHandle bs) (boundCount bs) 0 +> return (Query sqr Nothing Nothing sess (Just (boundParentStmt bs))) +> makeQuery sess bs@(BoundStmtCommand _ _) = do +> let pstmt = boundParentStmt bs +> let ru = QueryResourceUsage (stmtPrefetch pstmt) +> -- prefix "ff_" to prepared-stmt/cursor name to create unique statement +> -- name for fetch-forward statement. +> commencePreparedQuery sess ru (Just pstmt) (stmtName pstmt) ("ff_" ++ (stmtName pstmt)) + +Here we need to pop the next cursor name from the head of the list, +and use it to open + +> instance Statement (NextResultSet mark PreparedStmtObj) Session Query where +> makeQuery sess (NextResultSet (PreparedStmt pstmt)) = do +> cursors <- readIORef (stmtCursors pstmt) +> if null cursors then throwDB (DBError ("02", "000") (-1) "No more result sets to process.") else return () +> let (RefCursor cursor) = head cursors +> writeIORef (stmtCursors pstmt) (tail cursors) +> let ru = QueryResourceUsage (stmtPrefetch pstmt) +> commencePreparedQuery sess ru (Just pstmt) cursor cursor + + +> instance Statement (RefCursor String) Session Query where +> makeQuery sess (RefCursor cursor) = do +> let ru = QueryResourceUsage 0 +> commencePreparedQuery sess ru Nothing cursor cursor + + +Statements with resource usage + +> data QueryStringTuned = QueryStringTuned QueryResourceUsage String [BindA Session PreparedStmtObj BindObj] + +> sqlbind :: String -> [BindA Session PreparedStmtObj BindObj] -> QueryStringTuned +> sqlbind sql parms = QueryStringTuned defaultResourceUsage sql parms + +> prefetch :: Int -> String -> [BindA Session PreparedStmtObj BindObj] -> QueryStringTuned +> prefetch count sql parms = QueryStringTuned (QueryResourceUsage count) sql parms + +> instance Statement QueryStringTuned Session Query where +> makeQuery sess (QueryStringTuned resource_usage sqltext bas) = do +> let params = map (\(BindA ba) -> ba sess undefined) bas +> commence'query sess resource_usage sqltext params + + + +> commence'query'simple sess sqltext params = do +> subq <- create'subq sess $ +> convertEx $ DBAPI.stmtExecImm (dbHandle sess) (DBAPI.substituteBindPlaceHolders sqltext) params +> sqr <- newIORef subq +> return (Query sqr Nothing Nothing sess Nothing) + +Now, prepare and open the cursor + +> commence'query sess resourceUsage sqltext params +> | QueryResourceUsage{prefetchRowCount = 0} <- resourceUsage +> = commence'query'simple sess sqltext params + +> commence'query sess resourceUsage sqltext params = do +> let prepared'statement'name = "" -- meaning anonymous +> let default'cursor'name = "takusenp" +> let q = "DECLARE \"" ++ default'cursor'name ++ "\" NO SCROLL CURSOR FOR " ++ sqltext +> psname <- convertEx $ DBAPI.stmtPrepare (dbHandle sess) prepared'statement'name +> (DBAPI.substituteBindPlaceHolders q) (DBAPI.bindTypes params) +> convertEx $ DBAPI.execPreparedCommand (dbHandle sess) psname params +> commencePreparedQuery sess resourceUsage Nothing default'cursor'name default'cursor'name + + + +commencePreparedQueryn assumes that the DECLARE CURSOR statement +has been prepared and executed. +Note there are two statement names (and therefore two statements) in scope here. +The first is the name we give to the DECLARE CURSOR statement; +currently this is just "" (passed in by commence'query). +The second is the name given to the FETCH FORWARD statement, so that it can +be re-executed quickly and easily. +This is also passed in by commence'query, but if you look at commence'query, +you'll see that it is the same as the cursor name (currently "takusenp"). + +> commencePreparedQuery sess resourceUsage parentStmt cursorName prefetchStmtName = do +> let countStr = if (prefetchRowCount resourceUsage) <= 0 then "ALL" else (show $ prefetchRowCount resourceUsage) +> let fetchq = "FETCH FORWARD " ++ countStr ++ " FROM \"" ++ cursorName ++ "\"" +> sn <- convertEx $ DBAPI.stmtPrepare (dbHandle sess) prefetchStmtName fetchq [] +> let +> advanceA = convertEx (DBAPI.stmtExec0t (dbHandle sess) sn) +> cleanupA = do +> executeCommand sess ("CLOSE \"" ++ cursorName ++ "\"") +> deallocateStmt sess prefetchStmtName +> subq <- create'subq sess advanceA +> sqr <- newIORef subq +> return (Query sqr (Just advanceA) (Just cleanupA) sess parentStmt) + +> create'subq sess action = do +> (stmt,ntuples) <- action +> return $ SubQuery stmt ntuples 0 +> destroy'subq sess subq = convertEx $ DBAPI.stmtFinalise (stmtHandle subq) + + +> appendRefCursor query cname = do +> case queryStmt query of +> -- no parent stmt => probably just a doQuery over a RefCursor. +> -- Don't bother saving returned RefCursors. +> Nothing -> return () +> Just pstmt -> modifyIORef (stmtCursors pstmt) (++ [cname]) + +> instance IQuery Query Session ColumnBuffer where +> +> destroyQuery query = do +> subq <- readIORef (subquery query) +> destroy'subq (querySession query) subq +> maybe (return ()) id (cleanup'action query) +> +> fetchOneRow query = do +> let sess = querySession query +> subq' <- readIORef (subquery query) +> let subq = subq' { curr'row = succ (curr'row subq') } +> if ntuples subq == 0 +> then return False +> else if curr'row subq > ntuples subq +> then maybe +> (return False) -- no advance action: we're done +> (\action -> destroy'subq sess subq >> +> create'subq sess action >>= +> writeIORef (subquery query) >> +> fetchOneRow query +> ) +> (advance'action query) +> else writeIORef (subquery query) subq >> return True +> +> -- want to add a counter, so we can support this properly +> currentRowNum q = readIORef (subquery q) >>= return . curr'row +> +> freeBuffer q buffer = return () + +-------------------------------------------------------------------- +-- result-set data buffers implementation +-------------------------------------------------------------------- + +|There aren't really Buffers to speak of with PostgreSQL, +so we just record the position of each column. + +> data ColumnBuffer = ColumnBuffer { colPos :: Int } + +> buffer_pos q buffer = do +> row <- currentRowNum q +> return (row, colPos buffer) + +An auxiliary function: buffer allocation + +> allocBuffer q colpos = return $ ColumnBuffer { colPos = colpos } + +> bufferToAny fn query buffer = do +> subq <- readIORef (subquery query) +> ind <- DBAPI.colValNull (stmtHandle subq) (curr'row subq) (colPos buffer) +> if ind then return Nothing +> else +> fn (stmtHandle subq) (curr'row subq) (colPos buffer) +> >>= return . Just + +> instance DBType (Maybe String) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol = bufferToAny DBAPI.colValString + +> instance DBType (RefCursor String) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol query buffer = do +> subq <- readIORef (subquery query) +> (Just v) <- bufferToAny DBAPI.colValString query buffer +> appendRefCursor query (RefCursor v) +> return (RefCursor v) + +> instance DBType (Maybe UTCTime) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol = bufferToAny DBAPI.colValUTCTime + +> instance DBType (Maybe CalendarTime) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol = bufferToAny DBAPI.colValCalTime + +> instance DBType (Maybe Int) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol = bufferToAny DBAPI.colValInt + +> instance DBType (Maybe Double) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol = bufferToAny DBAPI.colValDouble + +> instance DBType (Maybe Float) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol = bufferToAny DBAPI.colValFloat + +> instance DBType (Maybe Int64) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol = bufferToAny DBAPI.colValInt64 + +|This single polymorphic instance replaces all of the type-specific non-Maybe instances +e.g. String, Int, Double, etc. + +> instance DBType (Maybe a) Query ColumnBuffer +> => DBType a Query ColumnBuffer where +> allocBufferFor _ = allocBufferFor (undefined::Maybe a) +> fetchCol q buffer = throwIfDBNull (buffer_pos q buffer) $ fetchCol q buffer + + +|This polymorphic instance assumes that the value is in a String column, +and uses Read to convert the String to a Haskell data value. + +> instance (Show a, Read a) => DBType (Maybe a) Query ColumnBuffer where +> allocBufferFor _ = allocBufferFor (undefined::String) +> fetchCol q buffer = do +> v <- bufferToAny DBAPI.colValString q buffer +> case v of +> Just s -> if s == "" then return Nothing else return (Just (read s)) +> Nothing -> return Nothing
+ Database/PostgreSQL/PGFunctions.lhs view
@@ -0,0 +1,725 @@+ +| +Module : Database.PostgreSQL.PGFunctions +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Simple wrappers for PostgreSQL functions (FFI) plus middle-level +wrappers (in the second part of this file) + +> {-# OPTIONS -ffi #-} +> {-# OPTIONS -fglasgow-exts #-} + +> module Database.PostgreSQL.PGFunctions where + +> import Database.Util +> import Control.Monad +> import Control.Exception +> import Data.Dynamic +> import Data.Int +> import Data.Time +> import Foreign +> import Foreign.C +> import Foreign.C.UTF8 +> import Foreign.Ptr +> import System.IO +> import System.Time + + +> data DBHandleStruct = PGconn +> type DBHandle = Ptr DBHandleStruct +> data StmtStruct = PGresult +> type ResultSetHandle = Ptr StmtStruct +> type Oid = CUInt -- from postgres_ext.h +> type Format = CInt +> type Void = () +> type ParamLen = CInt +> invalidOid = 0 +> -- type Blob = Ptr Word8 + +> data PGException = PGException Int String +> deriving (Typeable) + +> instance Show PGException where +> show (PGException i s) = "PGException " ++ (show i) ++ " " ++ s + +> catchPG :: IO a -> (PGException -> IO a) -> IO a +> catchPG = catchDyn + +> throwPG :: Integral a => a -> String -> any +> throwPG rc s = throwDyn (PGException (fromIntegral rc) s) + +> rethrowPG :: PGException -> any +> rethrowPG = throwDyn + +> cStr :: CStringLen -> CString +> cStr = fst +> cStrLen :: CStringLen -> CInt +> cStrLen = fromIntegral . snd + + +PG sends binary data in big-endian byte-order (AKA network byte order) +at least according to the manual page for the DECLARE command +(in the Reference section of the manual). + +The example C programs in the manual use the htonl/ntohl functions +to reverse the byte order before-sending/after-receiving (resp.) +I've included the decls here for reference, but we now use a +Haskell function to achieve the same result. +Note that this only works in little-endian platforms, like x86. +We need something better to detect endian-ness and choose whether +or not to reverse. + +include C:\MinGW\include\winsock.h + + foreign import stdcall "winsock.h htonl" htonl :: Word32 -> Word32 + foreign import stdcall "winsock.h ntohl" ntohl :: Word32 -> Word32 + +> foreign import ccall "libpq-fe.h PQconnectdb" fPQconnectdb +> :: CString -> IO DBHandle + +> foreign import ccall "libpq-fe.h PQfinish" fPQfinish +> :: DBHandle -> IO () + +From the PostgreSQL 8.0.0 docs, postgresql/libpq.html: + + This function will close the connection to the server and attempt to + reestablish a new connection to the same server, using all the same + parameters previously used. This may be useful for error recovery if a + working connection is lost. + +> foreign import ccall "libpq-fe.h PQreset" fPQreset +> :: DBHandle -> IO () + +Returns the database name of the connection +This is guaranteed by the Postgresql documentation to be a pure function + +> foreign import ccall "libpq-fe.h PQdb" fPQdb +> :: DBHandle -> CString + +Inquire the connection status + +> type ConnStatusType = CInt -- enumeration, see libpq-fe.h +> [eCONNECTION_OK,eCONNECTION_BAD] = [0..1]::[ConnStatusType] +> foreign import ccall "libpq-fe.h PQstatus" fPQstatus +> :: DBHandle -> IO ConnStatusType + +Returns the error message most recently generated by an operation on the +connection. + +> foreign import ccall "libpq-fe.h PQerrorMessage" fPQerrorMessage +> :: DBHandle -> IO CString + +Set client charset (UTF8 etc) + +> foreign import ccall "libpq-fe.h PQsetClientEncoding" fPQsetClientEncoding +> :: DBHandle -> CString -> IO CString + + + + +28.10. Notice Processing +We have a couple of callback hooks for server notice messages. + +The C decls are: + typedef void (*PQnoticeReceiver) (void *arg, const PGresult *res); + PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn, PQnoticeReceiver proc, void *arg); + + typedef void (*PQnoticeProcessor) (void *arg, const char *message); + PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn, PQnoticeProcessor proc, void *arg); + +> type NoticeReceiver = Ptr () -> ResultSetHandle -> IO () +> type NoticeProcessor = Ptr () -> CString -> IO () + +We need the wrapper to turn our NoticeReceiver-typed function +into something libpq can consume. +This decl will make GHC create the wrapper function for us. +GHC generates files PGFunctions_stub.h and PGFunctions_stub.c. + +The wrapper decl syntax is odd, as it's more an export than an import... + +> foreign import ccall "wrapper" mkNoticeReceiver :: +> NoticeReceiver -> IO (FunPtr NoticeReceiver) +> foreign import ccall "wrapper" mkNoticeProcessor :: +> NoticeProcessor -> IO (FunPtr NoticeProcessor) + +> foreign import ccall "libpq-fe.h PQsetNoticeReceiver" fPQsetNoticeReceiver +> :: DBHandle -> FunPtr NoticeReceiver -> Ptr () -> IO (FunPtr NoticeReceiver) +> foreign import ccall "libpq-fe.h PQsetNoticeProcessor" fPQsetNoticeProcessor +> :: DBHandle -> FunPtr NoticeProcessor -> Ptr () -> IO (FunPtr NoticeProcessor) + + + +Execution of commands + +We don't use fPQexec; the docs suggest fPQexecParams is better anyway +(better defense from SQL injection attacks, etc). + + foreign import ccall "libpq-fe.h PQexec" fPQexec + :: DBHandle -> CString -> IO ResultSetHandle + +> foreign import ccall "libpq-fe.h PQexecParams" fPQexecParams +> :: DBHandle -> CString -> CInt -> Ptr Oid -> Ptr Void -> Ptr ParamLen -> Ptr Format -> +> CInt -> IO ResultSetHandle + +> foreign import ccall "libpq-fe.h PQprepare" fPQprepare +> :: DBHandle -> CString -> CString -> CInt -> Ptr Oid -> IO ResultSetHandle + +> foreign import ccall "libpq-fe.h PQexecPrepared" fPQexecPrepared +> :: DBHandle -> CString -> CInt -> Ptr Void -> Ptr ParamLen -> Ptr Format -> +> CInt -> IO ResultSetHandle + + + +> foreign import ccall "libpq-fe.h PQresultStatus" fPQresultStatus +> :: ResultSetHandle -> IO ExecStatusType + +> type ExecStatusType = CInt -- enumeration, see libpq-fe.h +> (ePGRES_EMPTY_QUERY : +> ePGRES_COMMAND_OK : +> ePGRES_TUPLES_OK : +> ePGRES_COPY_OUT : +> ePGRES_COPY_IN : +> ePGRES_BAD_RESPONSE : +> ePGRES_NONFATAL_ERROR : +> ePGRES_FATAL_ERROR : +> _) +> = [0..] :: [ExecStatusType] + +> (textResultSet:binaryResultSet:_) = [0,1] :: [CInt] +> (textParameters:__binaryParameters:_) = [0,1] :: [CInt] + +> foreign import ccall "libpq-fe.h PQresultErrorMessage" fPQresultErrorMessage +> :: ResultSetHandle -> IO CString + +> foreign import ccall "libpq-fe.h PQclear" fPQclear +> :: ResultSetHandle -> IO () + + +Retrieving Query Result Information + +> foreign import ccall "libpq-fe.h PQntuples" fPQntuples +> :: ResultSetHandle -> IO CInt +> foreign import ccall "libpq-fe.h PQnfields" fPQnfields +> :: ResultSetHandle -> IO CInt + +Inquiry about a column; Column numbers start at 0 + +> foreign import ccall "libpq-fe.h PQfname" fPQfname +> :: ResultSetHandle -> CInt -> IO CString +> foreign import ccall "libpq-fe.h PQfformat" fPQfformat +> :: ResultSetHandle -> CInt -> IO CInt +> foreign import ccall "libpq-fe.h PQftype" fPQftype +> :: ResultSetHandle -> CInt -> IO Oid + +Really getting the values + +> foreign import ccall "libpq-fe.h PQgetvalue" fPQgetvalue +> :: ResultSetHandle -> CInt -> CInt -> IO (Ptr Word8) +> foreign import ccall "libpq-fe.h PQgetisnull" fPQgetisnull +> :: ResultSetHandle -> CInt -> CInt -> IO CInt +> foreign import ccall "libpq-fe.h PQgetlength" fPQgetlength +> :: ResultSetHandle -> CInt -> CInt -> IO CInt + +27.3.3. Retrieving Result Information for Other Commands + +> foreign import ccall "libpq-fe.h PQcmdStatus" fPQcmdStatus +> :: ResultSetHandle -> IO CString +> foreign import ccall "libpq-fe.h PQcmdTuples" fPQcmdTuples +> :: ResultSetHandle -> IO CString +> foreign import ccall "libpq-fe.h PQoidValue" fPQoidValue +> :: ResultSetHandle -> IO Oid + +27.8. Functions Associated with the COPY Command + +> foreign import ccall "libpq-fe.h PQputCopyData" fPQputCopyData +> :: DBHandle -> Ptr Word8 -> CInt -> IO CInt +> foreign import ccall "libpq-fe.h PQputCopyEnd" fPQputCopyEnd +> :: DBHandle -> CString -> IO CInt +> foreign import ccall "libpq-fe.h PQgetResult" fPQgetResult +> :: DBHandle -> IO ResultSetHandle + + +27.9. Control Functions + +> type PGVerbosity = CInt -- enumeration, see libpq-fe.h +> (ePQERRORS_TERSE : +> ePQERRORS_DEFAULT : +> ePQERRORS_VERBOSE : +> _) = [0..]::[PGVerbosity] +> foreign import ccall "libpq-fe.h PQsetErrorVerbosity" fPQsetErrorVerbosity +> :: DBHandle -> PGVerbosity -> IO PGVerbosity + +28.3. Large Objects. Client Interfaces + +> type LOAccessType = CInt -- enumeration, see libpq-fs.h +> [eINV_WRITE,eINV_READ] = [0x00020000,0x00040000]::[LOAccessType] +> type WhenceType = CInt -- enumeration, see <sys/unistd.h> +> [eSEEK_SET,eSEEK_CUR,eSEEK_END] = [0,1,2]::[WhenceType] + +> foreign import ccall "libpq-fe.h lo_creat" flo_creat +> :: DBHandle -> LOAccessType -> IO Oid + +> foreign import ccall "libpq-fe.h lo_import" flo_import +> :: DBHandle -> CString -> IO Oid +> foreign import ccall "libpq-fe.h lo_export" flo_export +> :: DBHandle -> Oid -> CString -> IO CInt + +> foreign import ccall "libpq-fe.h lo_open" flo_open +> :: DBHandle -> Oid -> LOAccessType -> IO CInt +> foreign import ccall "libpq-fe.h lo_write" flo_write +> :: DBHandle -> CInt -> Ptr Word8 -> CUInt -> IO CInt +> foreign import ccall "libpq-fe.h lo_read" flo_read +> :: DBHandle -> CInt -> Ptr Word8 -> CUInt -> IO CInt +> foreign import ccall "libpq-fe.h lo_lseek" flo_lseek +> :: DBHandle -> CInt -> CInt -> WhenceType -> IO CInt +> foreign import ccall "libpq-fe.h lo_tell" flo_tell +> :: DBHandle -> CInt -> IO CInt +> foreign import ccall "libpq-fe.h lo_close" flo_close +> :: DBHandle -> CInt -> IO CInt +> foreign import ccall "libpq-fe.h lo_unlink" flo_unlink +> :: DBHandle -> Oid -> IO CInt + + +------------------------------------------------------------------- + Middle-level interface + +Get the current error message + +> getError :: DBHandle -> IO String +> getError db = fPQerrorMessage db >>= peekUTF8String + +conn'parm is a string with all the attributes + +> openDb :: String -> IO DBHandle +> openDb conn'parm = +> withUTF8String conn'parm $ \cstr -> do +> db <- fPQconnectdb cstr +> if db == nullPtr +> then throwPG (-1) "Null PGconn handle from PQconnectdb" +> else do +> rc <- fPQstatus db +> if rc == eCONNECTION_OK +> then do +> setClientEncoding db "UTF8" +> return db +> else do +> emsg <- getError db +> fPQfinish db +> throwPG rc emsg + +> closeDb :: DBHandle -> IO () +> closeDb db = fPQfinish db + + +> ignoreNotices _ _ = return () +> reportNotices _ cstr = peekUTF8String cstr >>= hPutStrLn stderr + +> disableNoticeReporting db = do +> r <- mkNoticeProcessor ignoreNotices +> fPQsetNoticeProcessor db r nullPtr + +> enableNoticeReporting db = do +> r <- mkNoticeProcessor reportNotices +> fPQsetNoticeProcessor db r nullPtr + +> setErrorVerbosity db verb = fPQsetErrorVerbosity db verb >> return () + +> setClientEncoding db enc = +> withUTF8String enc (\s -> fPQsetClientEncoding db s) + +----------------------------------------------------------- + +Here we define a class useful in marshalling +Haskell values to and from their Postgres counterparts +(for binding and defining). + +We can find the OIDs with this query: + select oid, typname from pg_type + +Types we'll map: + 18 char + 25 text + 21 int2 + 23 int4 + 20 int8 + 700 float4 + 701 float8 +1114 timestamp +1184 timestamptz +1700 numeric + + +For ints and doubles/floats, we need to check what size they are +and choose the appropriate oid. + +PG timestamps are stored as 8-byte Doubles (i.e. double-precision +floating point) holding the seconds before or after midnight 2000-01-01. +date = oid 1082 (4 bytes) +time = oid 1083 (8 bytes) +timetz = oid 1266 (12 bytes) +timestamp (sans time zone) = oid 1114 (8 bytes) +timestamptz (with time zone) = oid 1184 (8 bytes) + +> class PGType a where +> pgTypeFormat :: a -> Format -- ^ 1 == binary (default), 0 == text +> pgTypeOid :: a -> Oid +> pgNewValue :: a -> IO (Ptr Word8) +> pgPeek :: Ptr Word8 -> IO a +> pgSize :: a -> Int +> -- default impls +> pgTypeFormat _ = textParameters + +> instance PGType a => PGType (Maybe a) where +> pgTypeFormat Nothing = pgTypeFormat (undefined::a) +> pgTypeFormat (Just v) = pgTypeFormat v +> pgTypeOid Nothing = pgTypeOid (undefined::a) +> pgTypeOid (Just v) = pgTypeOid v +> pgNewValue Nothing = return nullPtr +> pgNewValue (Just v) = pgNewValue v +> pgPeek ptr = if ptr == nullPtr then return Nothing else pgPeek ptr >>= return . Just +> pgSize Nothing = 0 -- what is the size of a null value?... probably irrelevant +> pgSize (Just v) = pgSize v + + +timestamp and timestamp with time zone are probably exactly the same +in terms of internal representation, so it's really just an input-output +semantics that the two types distinguish. + +> instance PGType UTCTime where +> pgTypeOid _ = 1114 +> pgNewValue v = pgNewValue (utcTimeToPGDatetime v) +> pgPeek p = pgPeek p >>= return . pgDatetimetoUTCTime +> pgSize v = pgSize (utcTimeToPGDatetime v) + +> instance PGType CalendarTime where +> pgTypeOid _ = 1114 +> pgNewValue v = pgNewValue (calTimeToPGDatetime v) +> pgPeek p = pgPeek p >>= return . pgDatetimetoCalTime +> pgSize v = pgSize (calTimeToPGDatetime v) + +We assume all Strings are UTF8 encoded. + +> instance PGType String where +> pgTypeOid _ = 25 +> pgNewValue s = newUTF8String s >>= return . castPtr +> pgPeek p = peekUTF8String (castPtr p) >>= return +> pgSize s = lengthUTF8 s + +> instance PGType Char where +> pgTypeOid _ = 18 +> -- need to cast to CChar because we don't know what the Storable instance +> -- for Char does; does it write 4 bytes, or just the lowest one? +> pgNewValue v = malloc >>= \p -> poke p (toCChar v) >> return (castPtr p) +> pgPeek p = peek (castPtr p) >>= return . fromCChar +> pgSize _ = sizeOf 'a' + +> instance PGType Int16 where +> pgTypeOid _ = 21 +> pgNewValue v = pgNewValue (show v) +> pgPeek p = pgPeek p >>= return . read +> pgSize v = pgSize (show v) + +> instance PGType Int32 where +> pgTypeOid _ = 23 +> pgNewValue v = pgNewValue (show v) +> pgPeek p = pgPeek p >>= return . read +> pgSize v = pgSize (show v) + +> instance PGType Int64 where +> pgTypeOid _ = 20 +> pgNewValue v = pgNewValue (show v) +> pgPeek p = pgPeek p >>= return . read +> pgSize v = pgSize (show v) + +> instance PGType Int where +> pgTypeOid v = 1700 +> pgNewValue v = pgNewValue (show v) +> pgPeek p = pgPeek p >>= return . read +> pgSize v = pgSize (show v) + +> instance PGType Integer where +> pgTypeOid v = 1700 +> pgNewValue v = pgNewValue (show v) +> pgPeek p = pgPeek p >>= return . read +> pgSize v = pgSize (show v) + +> instance PGType Double where +> pgTypeOid v = 1700 +> pgNewValue v = pgNewValue (show v) +> pgPeek p = pgPeek p >>= return . read +> pgSize v = pgSize (show v) + +> instance PGType Float where +> pgTypeOid v = 1700 +> pgNewValue v = pgNewValue (show v) +> pgPeek p = pgPeek p >>= return . read +> pgSize v = pgSize (show v) + +> data PGBindVal = PGBindVal +> { bindValOid :: Oid +> , bindValFormat :: Format +> , bindValSize :: CInt +> , bindValPtr :: IO (Ptr Word8) +> } + +newBindVal is useful when creating lists of bind values, +for passing to the stmtExec and prepare'n'exec functions. + +> newBindVal v = PGBindVal (pgTypeOid v) (pgTypeFormat v) (toCInt (pgSize v)) (pgNewValue v) + +> bindTypes vs = map bindValOid vs + + +> toCChar :: Char -> CChar; toCChar = toEnum . fromEnum +> fromCChar :: CChar -> Char; fromCChar = toEnum . fromEnum + +> toCInt :: Int -> CInt; toCInt = fromIntegral + +----------------------------------------------------------- + +Check the ResultSetHandle returned by fPQexec and similar functions + +> check'stmt :: DBHandle -> ExecStatusType -> ResultSetHandle -> IO ResultSetHandle +> check'stmt db _ stmt +> | stmt == nullPtr = do -- something is really wrong +> emsg <- getError db +> rc <- fPQstatus db +> throwPG rc emsg +> check'stmt _ expected'status stmt = do +> rc <- fPQresultStatus stmt +> if rc == expected'status then return stmt +> else do +> msg <- fPQresultErrorMessage stmt >>= peekUTF8String +> fPQclear stmt +> throwPG rc msg + +> stmtPrepare :: DBHandle -> String -> String -> [Oid] -> IO String +> stmtPrepare db stmt'name sqlText types = +> withUTF8String stmt'name $ \csn -> do +> withUTF8String sqlText $ \cstr -> do +> withArray types $ \ctypearray -> do +> let np = fromIntegral $ length types +> stmt <- fPQprepare db csn cstr np ctypearray +> check'stmt db ePGRES_COMMAND_OK stmt +> fPQclear stmt -- doesn't have any useful info +> return stmt'name + + +Execute some kind of statement that returns no tuples. +Because this is a frequently used function, we code it specially +(rather than invoking a more generic execCommand). + +> nqExec :: DBHandle -> String -> IO (String, String, Oid) +> nqExec db sqlText = +> withUTF8String sqlText $ \cstr -> +> do +> stmt <- fPQexecParams db cstr 0 nullPtr nullPtr nullPtr nullPtr textResultSet +> >>= check'stmt db ePGRES_COMMAND_OK +> -- save all information from PGresult and free it +> cmd'status <- fPQcmdStatus stmt >>= peekUTF8String +> cmd'ntuples <- fPQcmdTuples stmt >>= peekUTF8String +> cmd'oid <- fPQoidValue stmt +> fPQclear stmt +> return (cmd'status, cmd'ntuples, cmd'oid) + +> execCommand :: DBHandle -> String -> [PGBindVal] -> IO (String, String, Oid) +> execCommand db sqlText bindvals = do +> stmtPrepare db "" sqlText (bindTypes bindvals) +> execPreparedCommand db "" bindvals + +| This is for commands, as opposed to queries. +The query equivalent of 'execPreparedCommand' is 'stmtExec'. + +> execPreparedCommand :: DBHandle -> String -> [PGBindVal] -> IO (String, String, Oid) +> execPreparedCommand db stmtname bindvals = do +> (rs, ntuples) <- execPrepared db stmtname bindvals ePGRES_COMMAND_OK +> -- save all information from PGresult and free it +> cmd'status <- fPQcmdStatus rs >>= peekUTF8String +> cmd'ntuples <- fPQcmdTuples rs >>= peekUTF8String +> cmd'oid <- fPQoidValue rs +> stmtFinalise rs +> return (cmd'status, cmd'ntuples, cmd'oid) + +Prepare and Execute a query. Returns results as binary. + +> stmtExecImm :: DBHandle -> String -> [PGBindVal] -> IO (ResultSetHandle, Int) +> stmtExecImm db sqlText bindvals = do +> let np = fromIntegral $ length bindvals +> withUTF8String sqlText $ \cstr -> do +> withArray (map bindValOid bindvals) $ \coidarray -> do +> withArray (map bindValSize bindvals) $ \clenarray -> do +> withArray (map bindValFormat bindvals) $ \cformatarray -> do +> -- The bindValPtrs are IO actions; executing them (via sequence) +> -- creates the bind values (allocates storage, pokes values, etc). +> -- We must remember to free these later. +> paramlist <- sequence (map bindValPtr bindvals) +> withArray paramlist $ \cparamarray -> do +> rs <- fPQexecParams db cstr np coidarray (castPtr cparamarray) clenarray cformatarray textResultSet +> mapM_ (\p -> if p == nullPtr then return () else free p) paramlist +> check'stmt db ePGRES_TUPLES_OK rs +> ntuples <- fPQntuples rs +> return (rs, fromIntegral ntuples) + + +A simple version with no binding parameters and returning results as text + +> stmtExecImm0 :: DBHandle -> String -> IO (ResultSetHandle, Int) +> stmtExecImm0 db sqlText = +> withUTF8String sqlText $ \cstr -> do +> rs <- fPQexecParams db cstr 0 nullPtr nullPtr nullPtr nullPtr textResultSet +> check'stmt db ePGRES_TUPLES_OK rs +> ntuples <- fPQntuples rs +> return (rs, fromIntegral ntuples) + + +Execute a previously prepared query, with no params. + +> stmtExec0 :: DBHandle -> String -> IO (ResultSetHandle, Int) +> stmtExec0 db stmt'name = stmtExec0bt db stmt'name binaryResultSet + +> stmtExec0t :: DBHandle -> String -> IO (ResultSetHandle, Int) +> stmtExec0t db stmt'name = stmtExec0bt db stmt'name textResultSet + +> stmtExec0bt db stmt'name binary_or_text = +> withUTF8String stmt'name $ \cstmtname -> do +> rs <- fPQexecPrepared db cstmtname 0 nullPtr nullPtr nullPtr +> binary_or_text +> check'stmt db ePGRES_TUPLES_OK rs +> ntuples <- fPQntuples rs +> return (rs, fromIntegral ntuples) + + +Execute a previously prepared query, with params. + +> stmtExec :: DBHandle -> String -> [PGBindVal] -> IO (ResultSetHandle, Int) +> stmtExec db stmt'name bindvals = execPrepared db stmt'name bindvals ePGRES_TUPLES_OK + +This is used for both queries and commands. +We have to pass the expected PQresult code, because +queries return ePGRES_TUPLES_OK while commands return ePGRES_COMMAND_OK. + +> execPrepared :: DBHandle -> String -> [PGBindVal] -> CInt -> IO (ResultSetHandle, Int) +> execPrepared db stmt'name bindvals rc = do +> let np = fromIntegral $ length bindvals +> withUTF8String stmt'name $ \cstmtname -> do +> withArray (map bindValSize bindvals) $ \clenarray -> do +> withArray (map bindValFormat bindvals) $ \cformatarray -> do +> -- The bindValPtrs are IO actions; executing them (via sequence) +> -- creates the bind values (allocates storage, pokes values, etc). +> -- We must remember to free these later. +> paramlist <- sequence (map bindValPtr bindvals) +> withArray paramlist $ \cparamarray -> do +> rs <- fPQexecPrepared db cstmtname np (castPtr cparamarray) clenarray cformatarray textResultSet +> mapM_ (\p -> if p == nullPtr then return () else free p) paramlist +> check'stmt db rc rs +> ntuples <- fPQntuples rs +> return (rs, fromIntegral ntuples) + +> prepare'n'exec :: DBHandle -> String -> String -> [PGBindVal] -> IO (ResultSetHandle, Int) +> prepare'n'exec db stmtname stmt bindvals = do +> let np = fromIntegral $ length bindvals +> withUTF8String stmtname $ \cstmtname -> do +> withUTF8String stmt $ \cstmt -> do +> withArray (map bindValOid bindvals) $ \coidarray -> do +> rs <- fPQprepare db cstmtname cstmt np coidarray +> check'stmt db ePGRES_COMMAND_OK rs +> execPrepared db stmtname bindvals ePGRES_TUPLES_OK + + +Free storage, that is. No error in Postgres + +> stmtFinalise :: ResultSetHandle -> IO () +> stmtFinalise = fPQclear + +|Column numbers are zero-indexed, so subtract one +from given index (we present a one-indexed interface). +So are the row numbers. + +> colValPtr :: ResultSetHandle -> Int -> Int -> IO (Ptr Word8) +> colValPtr rs row col = do +> n <- fPQntuples rs +> if (fromIntegral n) < row || row < 1 +> then throwPG (-1) ("Attempted fetch from invalid row number " ++ show row) +> else fPQgetvalue rs (toCInt (row-1)) (toCInt (col-1)) >>= return . castPtr + +> colVal :: PGType a => ResultSetHandle -> Int -> Int -> IO a +> colVal rs row col = colValPtr rs row col >>= pgPeek + +> colValString :: ResultSetHandle -> Int -> Int -> IO String +> colValString = colVal + +> colValInt :: ResultSetHandle -> Int -> Int -> IO Int +> colValInt = colVal + +> colValInt64 :: ResultSetHandle -> Int -> Int -> IO Int64 +> colValInt64 = colVal + +> colValDouble :: ResultSetHandle -> Int -> Int -> IO Double +> colValDouble = colVal + +> colValFloat :: ResultSetHandle -> Int -> Int -> IO Float +> colValFloat = colVal + +> colValUTCTime :: ResultSetHandle -> Int -> Int -> IO UTCTime +> colValUTCTime = colVal + +> colValCalTime :: ResultSetHandle -> Int -> Int -> IO CalendarTime +> colValCalTime = colVal + +> colValNull :: ResultSetHandle -> Int -> Int -> IO Bool +> colValNull rs row col = do +> ind <- fPQgetisnull rs (toCInt (row-1)) (toCInt (col-1)) +> return (ind /= 0) + +> {- +> colValBlob :: ResultSetHandle -> Int -> Int -> IO (ForeignPtr Blob) +> colValBlob rs row col = do +> let ccolnum = fromIntegral (colnum - 1) +> bytes <- sqliteColumnBytes stmt ccolnum +> src <- sqliteColumnBlob stmt ccolnum +> buffer <- mallocForeignPtrBytes bytes +> withForeignPtr buffer $ \dest -> copyBytes dest src bytes +> return (castForeignPtr buffer) +> -} + +> substituteBindPlaceHolders sql = sbph sql 1 False "" + +> sbph :: String -> Int -> Bool -> String -> String +> sbph [] _ _ acc = reverse acc +> sbph ('\'':cs) i inQuote acc = sbph cs i (not inQuote) ('\'':acc) +> sbph ('?':cs) i False acc = sbph cs (i+1) False ((reverse (show i)) ++ ('$':acc)) +> sbph (c:cs) i inQuote acc = sbph cs i inQuote (c:acc) + + +Execute the COPY FROM STDIN command + +> nqCopyIn_buflen :: Int +> nqCopyIn_buflen = 8192 + +> nqCopyIn :: DBHandle -> String -> Handle -> IO () +> nqCopyIn db sqlText hin = +> withUTF8String sqlText $ \cstr -> +> allocaBytes nqCopyIn_buflen $ \buffer -> +> do +> stmt <- fPQexecParams db cstr 0 nullPtr nullPtr nullPtr nullPtr 0 +> >>= check'stmt db ePGRES_COPY_IN +> let check'copy'status 1 = return () +> check'copy'status _ = do +> emsg <- getError db +> rc <- fPQstatus db +> throwPG rc emsg +> let loop = do +> len <- hGetBuf hin buffer nqCopyIn_buflen +> if len < 0 then withUTF8String "IO error" $ fPQputCopyEnd db +> else if len == 0 then fPQputCopyEnd db nullPtr +> else fPQputCopyData db buffer (fromIntegral len) >>= +> check'copy'status >> loop +> res <- loop +> fPQclear stmt +> check'copy'status res +> -- finishing, checking the final status +> fPQgetResult db >>= check'stmt db ePGRES_COMMAND_OK >>= fPQclear
+ Database/PostgreSQL/Test/Enumerator.lhs view
@@ -0,0 +1,347 @@+ +| +Module : Database.PostgreSQL.Test.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + + + +Can we support database functions that return/create multiple result-sets? +Oracle, MS Sql Server, and Sybase have them, +and we can simulate them in Postgres with the code below. + +CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler; + +CREATE OR REPLACE VIEW t_whole as +select 0 as n +union select 1 +union select 2 +union select 3 +union select 4 +union select 5 +union select 6 +union select 7 +union select 8 +union select 9 +; + +CREATE OR REPLACE VIEW t_natural as +select n from +( select t1.n + 10 * t10.n + 100 * t100.n as n + from t_whole t1, t_whole t10, t_whole t100 +) t +where n > 0 +order by 1 +; + +DROP FUNCTION takusenTestFunc() ; + +CREATE OR REPLACE FUNCTION takusenTestFunc() RETURNS SETOF refcursor AS \$\$ +DECLARE refc1 refcursor; refc2 refcursor; +BEGIN + OPEN refc1 FOR SELECT n*n from t_natural where n < 10 order by 1; + RETURN NEXT refc1; + OPEN refc2 FOR SELECT n, n*n, n*n*n from t_natural where n < 10 order by 1; + RETURN NEXT refc2; +END;\$\$ LANGUAGE plpgsql; + + +-- this select returns two values (rows), both strings (well, refcursors), +-- which are the cursor names. +select * from myfunc(); + +fetch all from "<unnamed portal 1>"; +fetch all from "<unnamed portal 2>"; +commit; + + +Another example: + +CREATE OR REPLACE FUNCTION takusenTestFunc(lim int4) RETURNS refcursor AS \$\$ +DECLARE + refc refcursor; +BEGIN + OPEN refc FOR SELECT n, takusenTestFunc2(n) from t_natural where n < lim order by n; + RETURN refc; +END; +\$\$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION takusenTestFunc2(lim int4) RETURNS refcursor AS \$\$ +DECLARE + refc refcursor; +BEGIN + OPEN refc FOR SELECT n from t_natural where n < lim order by n; + RETURN refc; +END; +\$\$ LANGUAGE plpgsql; + +SELECT n, takusenTestFunc(n) from t_natural where n < 10 order by n; + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.PostgreSQL.Test.Enumerator (runTest) where + +> import qualified Database.PostgreSQL.Test.PGFunctions as Low +> import Database.PostgreSQL.Enumerator +> import Database.Test.Performance as Perf +> import Database.Test.Enumerator +> import Control.Monad (when) +> import Control.Exception (throwDyn) +> import Test.MiniUnit +> import Data.Int +> import Data.List +> import System.Time + + +> runTest :: Perf.ShouldRunTests -> [String] -> IO () +> runTest runPerf args = do +> putStrLn "PostgreSQL tests" +> let (user:pswd:dbname:_) = args +> Low.runTest user +> flip catchDB basicDBExceptionReporter $ do +> (r, conn1) <- withContinuedSession (connect [CAuser user]) (testBody runPerf) +> withSession conn1 testPartTwo + +> testBody runPerf = do +> runFixture PGSqlFunctions +> when (runPerf == Perf.RunTests) runPerformanceTests + +> testPartTwo = do +> makeFixture execDrop execDDL_ +> destroyFixture execDDL_ + +> runPerformanceTests = do +> makeFixture execDrop execDDL_ +> beginTransaction RepeatableRead +> runTestTT "PostgreSQL performance tests" (map (flip catchDB reportRethrow) +> [ timedSelect (prefetch 1000 sqlRows2Power20 []) 40 (2^20) +> , timedSelect (prefetch 1 sqlRows2Power17 []) 40 (2^17) +> , timedSelect (prefetch 1000 sqlRows2Power17 []) 5 (2^17) +> , timedCursor (prefetch 1 sqlRows2Power17 []) 40 (2^17) +> , timedCursor (prefetch 1000 sqlRows2Power17 []) 5 (2^17) +> ] +> ) +> commit +> destroyFixture execDDL_ + + +> runFixture :: PGSqlFunctions -> DBM mark Session () +> runFixture fns = do +> makeFixture execDrop execDDL_ +> execDDL_ makeFixtureNestedMultiResultSet1 +> execDDL_ makeFixtureNestedMultiResultSet2 +> execDDL_ makeFixtureNestedMultiResultSet3 +> execDDL_ makeFixtureNestedMultiResultSet4 +> execDDL_ makeFixtureMultiResultSet1 +> runTestTT "Postgres tests" (map (runOneTest fns) testList) +> execDDL_ dropFixtureMultiResultSet1 +> execDDL_ dropFixtureNestedMultiResultSet4 +> execDDL_ dropFixtureNestedMultiResultSet3 +> execDDL_ dropFixtureNestedMultiResultSet2 +> execDDL_ dropFixtureNestedMultiResultSet1 +> destroyFixture execDDL_ + +> runOneTest fns t = catchDB (t fns) reportRethrow + +----------------------------------------------------------- + +> selectNoRows _ = selectTest sqlNoRows iterNoRows expectNoRows + +> selectTerminatesEarly _ = selectTest sqlTermEarly iterTermEarly expectTermEarly + +> selectFloatsAndInts fns = selectTest (sqlFloatsAndInts fns) iterFloatsAndInts expectFloatsAndInts + +> selectNullString _ = selectTest sqlNullString iterNullString expectNullString + +> selectEmptyString _ = selectTest sqlEmptyString iterEmptyString expectEmptyString + +> selectUnhandledNull _ = catchDB ( do +> selectTest sqlUnhandledNull iterUnhandledNull expectUnhandledNull +> assertFailure sqlUnhandledNull +> ) (\e -> return () ) + + + +> selectNullDate dateFn = selectTest (sqlNullDate dateFn) iterNullDate expectNullDate + +> selectDate dateFn = selectTest (sqlDate dateFn) iterDate expectDate + +> selectCalDate dateFn = selectTest (sqlDate dateFn) iterCalDate expectCalDate + +> selectBoundaryDates dateFn = selectTest (sqlBoundaryDates dateFn) iterBoundaryDates expectBoundaryDates + +> selectCursor fns = actionCursor (sqlCursor fns) + +> selectExhaustCursor fns = actionExhaustCursor (sqlCursor fns) + +Note that these two tests use the same prepared statement name. +This tests that the statement is properly deallocated, through use of +withPreparedStatement. + +> selectBindString _ = actionBindString +> (prepareQuery "1" (sql sqlBindString) [bindType "", bindType ""]) +> [bindP "a2", bindP "b1"] + +> selectBindInt _ = actionBindInt +> (prepareQuery "1" (sql sqlBindInt) (map bindType expectBindInt)) +> [bindP (1::Int), bindP (2::Int)] + + +> selectBindIntDoubleString _ = actionBindIntDoubleString +> (prefetch 0 sqlBindIntDoubleString [bindP (1::Int), bindP (2.2::Double), bindP "row 1", bindP (3::Int), bindP (4.4::Double), bindP "row 2"]) + +> selectBindDate _ = actionBindDate +> (prefetch 1 sqlBindDate (map bindP expectBindDate)) + +> selectBindBoundaryDates _ = actionBindBoundaryDates +> (prefetch 1 sqlBindBoundaryDates (map bindP expectBoundaryDates)) + +> selectRebindStmt _ = actionRebind +> (prepareQuery "1" (sql sqlRebind) [bindType (0::Int)]) +> [bindP (1::Int)] [bindP (2::Int)] + +> boundStmtDML _ = actionBoundStmtDML +> (prepareCommand "boundStmtDML" (sql sqlBoundStmtDML) [bindType (0::Int), bindType ""]) +> boundStmtDML2 _ = do +> beginTransaction RepeatableRead +> count <- execDML (cmdbind sqlBoundStmtDML [bindP (100::Int), bindP "100"]) +> rollback +> assertEqual sqlBoundStmtDML 1 count + + +> polymorphicFetchTest _ = actionPolymorphicFetch +> (prefetch 0 sqlPolymorphicFetch [bindP expectPolymorphicFetch]) + +> polymorphicFetchTestNull _ = withTransaction RepeatableRead $ +> actionPolymorphicFetchNull (prefetch 1 sqlPolymorphicFetchNull []) + +For the exceptionRollback test we have to specify the count result is int4; +if we don't specify the type then it defaults to a Postgres numeric, +which we can't yet marshal. + +> exceptionRollback _ = actionExceptionRollback sqlInsertTest4 +> ("select count(*)::int4 from " ++ testTable) + + + +> selectUTF8Text _ = do +> let iter (s::String) (_::String) = result s +> -- GREEK SMALL LETTER PHI : CF86 UTF8, 03C6 UTF16, 966 decimal +> let expect = ['\966'] +> result <- doQuery (sql ("select '" ++ expect ++ "'")) iter "" +> assertEqual "selectUTF8Text" expect result + + +> dropFixtureMultiResultSet1 = "DROP FUNCTION takusenTestFunc()" +> makeFixtureMultiResultSet1 = +> "CREATE OR REPLACE FUNCTION takusenTestFunc() RETURNS SETOF refcursor AS $$" +> ++ "DECLARE refc1 refcursor; refc2 refcursor; BEGIN" +> ++ " OPEN refc1 FOR SELECT n*n from t_natural where n < 10 order by 1;" +> ++ " RETURN NEXT refc1;" +> ++ " OPEN refc2 FOR SELECT n, n*n, n*n*n from t_natural where n < 10 order by 1;" +> ++ " RETURN NEXT refc2;" +> ++ "END;$$ LANGUAGE plpgsql;\n" + +> selectMultiResultSet _ = do +> withTransaction RepeatableRead $ do +> withPreparedStatement (prepareLargeQuery 2 "stmt1" (sql "select * from takusenTestFunc()") []) $ \pstmt -> do +> withBoundStatement pstmt [] $ \bstmt -> do +> dummy <- doQuery bstmt iterMain [] +> result1 <- doQuery (NextResultSet pstmt) iterRS1 [] +> assertEqual "selectMultiResultSet: RS1" [1,4,9,16,25,36,49,64,81] result1 +> result2 <- doQuery (NextResultSet pstmt) iterRS2 [] +> let expect = [(1,1,1),(2,4,8),(3,9,27),(4,16,64),(5,25,125),(6,36,216) +> ,(7,49,343),(8,64,512),(9,81,729)] +> assertEqual "selectMultiResultSet: RS2" expect result2 +> return () +> where +> iterMain :: (Monad m) => (RefCursor String) -> IterAct m [RefCursor String] +> iterMain c acc = result (acc ++ [c]) +> iterRS1 :: (Monad m) => Int -> IterAct m [Int] +> iterRS1 i acc = result (acc ++ [i]) +> iterRS2 :: (Monad m) => Int -> Int -> Int -> IterAct m [(Int, Int, Int)] +> iterRS2 i i2 i3 acc = result (acc ++ [(i, i2, i3)]) + + + +> dropFixtureNestedMultiResultSet1 = "DROP VIEW t_whole" +> makeFixtureNestedMultiResultSet1 = "CREATE OR REPLACE VIEW t_whole as" +> ++ " select 0 as n union select 1 union select 2 union select 3 union select 4" +> ++ " union select 5 union select 6 union select 7 union select 8 union select 9" + +> dropFixtureNestedMultiResultSet2 = "DROP VIEW t_natural" +> makeFixtureNestedMultiResultSet2 = "CREATE OR REPLACE VIEW t_natural as" +> ++ " select n from" +> ++ " ( select t1.n + 10 * t10.n + 100 * t100.n as n" +> ++ " from t_whole t1, t_whole t10, t_whole t100" +> ++ " ) t where n > 0 order by 1" + +> dropFixtureNestedMultiResultSet3 = "DROP FUNCTION takusenTestFunc(int4)" +> makeFixtureNestedMultiResultSet3 = +> "CREATE OR REPLACE FUNCTION takusenTestFunc(lim int4) RETURNS refcursor AS $$" +> ++ " DECLARE refc refcursor; BEGIN" +> ++ " OPEN refc FOR SELECT n, takusenTestFunc2(n) from t_natural where n < lim order by n;" +> ++ " RETURN refc; END; $$ LANGUAGE plpgsql;" + +> dropFixtureNestedMultiResultSet4 = "DROP FUNCTION takusenTestFunc2(int4)" +> makeFixtureNestedMultiResultSet4 = +> "CREATE OR REPLACE FUNCTION takusenTestFunc2(lim int4) RETURNS refcursor AS $$" +> ++ " DECLARE refc refcursor; BEGIN" +> ++ " OPEN refc FOR SELECT n from t_natural where n < lim order by n;" +> ++ " RETURN refc; END; $$ LANGUAGE plpgsql;" + +> selectNestedMultiResultSet _ = do +> let +> q = "SELECT n, takusenTestFunc(n) from t_natural where n < 10 order by n" +> iterMain (i::Int) (c::RefCursor String) acc = result' ((i,c):acc) +> iterInner (i::Int) (c::RefCursor String) acc = result' ((i,c):acc) +> iterInner2 (i::Int) acc = result' (i:acc) +> withTransaction RepeatableRead $ do +> rs <- doQuery (sql q) iterMain [] +> assertEqual "selectNestedMultiResultSet" [9,8,7,6,5,4,3,2,1] (map fst rs) +> --print_ "" +> flip mapM_ rs $ \(outer, c) -> do +> rs <- doQuery c iterInner [] +> let expect = drop (9-outer) [8,7,6,5,4,3,2,1] +> assertEqual "processOuter" expect (map fst rs) +> flip mapM_ rs $ \(inner, c) -> do +> rs <- doQuery c iterInner2 [] +> let expect = drop (9-inner) [8,7,6,5,4,3,2,1] +> assertEqual "processInner" expect rs +> flip mapM_ rs $ \i -> do +> --print_ (show outer ++ " " ++ show inner ++ " " ++ show i) +> assertBool "processInner2" (i < inner) + + + +> generateErrorMessageTest _ = do +> catchDB ( do +> doQuery (sql "select * from nonExistantObject") iterNoRows [] +> return () +> ) (\e -> do +> let msg = formatDBException e +> -- uncomment this to view error message +> --liftIO (putStrLn msg) +> let expect = "42P01 7: ERROR: 42P01: relation" +> assertEqual "generateErrorMessageTest" expect (take (length expect) msg) +> ) + + +> testList :: [PGSqlFunctions -> DBM mark Session ()] +> testList = +> [ selectNoRows, selectTerminatesEarly, selectFloatsAndInts +> , selectNullString, selectEmptyString, selectUnhandledNull +> , selectNullDate, selectDate, selectCalDate, selectBoundaryDates +> , selectCursor, selectExhaustCursor +> , selectBindString, selectBindInt, selectBindIntDoubleString +> , selectBindDate, selectBindBoundaryDates, selectRebindStmt +> , boundStmtDML, boundStmtDML2 +> , polymorphicFetchTest, polymorphicFetchTestNull, exceptionRollback +> , selectMultiResultSet, selectNestedMultiResultSet +> , generateErrorMessageTest, selectUTF8Text +> ]
+ Database/PostgreSQL/Test/PGFunctions.lhs view
@@ -0,0 +1,385 @@+ +| +Module : Database.PostgreSQL.Test.PGFunctions +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + + +> {-# OPTIONS -fglasgow-exts #-} + +> module Database.PostgreSQL.Test.PGFunctions (runTest) where + + +> import Database.PostgreSQL.PGFunctions +> import Database.Util +> import Foreign +> import Foreign.C +> import Control.Monad +> import Control.Exception +> import Data.Dynamic +> import System.Environment (getArgs) +> import Test.MiniUnit +> import Data.Char +> import Data.Time + + +This low-level test assumes that the user has a database with their name. +If not, it won't work. I have a postgres user and a postgres database. + +> runTest :: String -> IO () +> runTest dbname = printPropagateError $ do +> testOpen ("user=" ++ dbname) +> db <- openDb ("user=" ++ dbname) +> disableNoticeReporting db +> createFixture db +> runTestTT "Postgres low-level tests" (testlist db) +> destroyFixture db +> closeDb db + +> testlist db = map ($ db) +> [ testSelectInts +> , testSelectDouble +> , testSelectDate +> , testSelectDate2 +> , testSelectDate3 +> , testSelectNumeric +> , testSelectStrings +> , testSelectInt64 +> , testSelectNoRows +> , testUnion +> , testSelectManyRows +> , testBindString +> , testBindInt +> , testBindDouble +> , testBindDate +> , testCreateDual +> , testSelectUTF8Text +> ] + + +> ignoreError action = catchPG action (const (return ())) + +> printIgnoreError action = catchPG action (putStrLn . show) + +> printPropagateError action = catchPG action +> (\e -> putStrLn (show e) >> rethrowPG e) + +> ddlExec db stmt = nqExec db stmt >> return () + +> testOpen connstr = openDb connstr >>= closeDb + +> createFixture db = do +> -- ignoreError $ ddlExec db "drop table tdual" +> -- ignoreError $ ddlExec db "drop table t_natural" +> -- ignoreError $ ddlExec db "drop table t_blob" +> printPropagateError $ +> ddlExec db "create temp table tdual (dummy text primary key)" +> printPropagateError $ +> ddlExec db "insert into tdual (dummy) values ('X')" +> printPropagateError $ ddlExec db +> "create temp table t_natural (n integer primary key)" +> mapM_ (insertNatural db) [1,2,64,65534,65535,65536] +> printPropagateError $ +> ddlExec db "create temp table t_blob (b bytea)" +> printPropagateError $ +> ddlExec db "insert into t_blob values ('blobtest')" + +> insertNatural db n = do +> ddlExec db $ "insert into t_natural values (" ++ (show n) ++ ")" + + + +> destroyFixture db = return () -- our tables are temporary + +> testCreateDual db = do +> ignoreError ( do +> ddlExec db "create temp table tdual (dummy integer primary key)" +> assertFailure "PGException not thrown when table already exists" +> ) +> printPropagateError $ ddlExec db "insert into tdual values (1)" + + +> testSelectStrings db = do +> sn <- printPropagateError $ +> stmtPrepare db "" "select text(n) from t_natural where n < 3 order by n;" [] +> (stmt,ntuples) <- stmtExec0t db sn +> assertEqual "testSelectInts: ntuples" 2 ntuples +> n <- colValString stmt 1 1 +> assertEqual "testSelectInts: 1" 1 (read n) +> n <- colValString stmt 2 1 +> assertEqual "testSelectInts: 2" 2 (read n) +> stmtFinalise stmt + +> testSelectInts db = do +> sn <- printPropagateError $ +> stmtPrepare db "" "select n from t_natural where n < 65536 order by n;" [] +> (rs,ntuples) <- stmtExec0t db sn +> assertEqual "testSelectInts: ntuples" 5 ntuples +> n <- colValInt rs 1 1 +> assertEqual "testSelectInts: 1" 1 n +> n <- colValInt rs 2 1 +> assertEqual "testSelectInts: 2" 2 n +> n <- colValInt rs 3 1 +> assertEqual "testSelectInts: 64" 64 n +> n <- colValInt rs 4 1 +> assertEqual "testSelectInts: 65534" 65534 n +> stmtFinalise rs + +> testSelectInt64 db = do +> sn <- printPropagateError $ +> stmtPrepare db "" "select 20041225235959" [] +> --stmtPrepare db "" "select -1 union select 1 union select 2*1000*1000*1000 order by 1" +> (stmt,ntuples) <- stmtExec0t db sn +> n <- colValInt64 stmt 1 1 +> assertEqual "testSelectInt64: 20041225235959" 20041225235959 n +> stmtFinalise stmt + + +> testSelectDouble db = do +> sn <- printPropagateError $ stmtPrepare db "" "select 1.2::float8" [] +> (stmt,ntuples) <- stmtExec0t db sn +> n <- colValDouble stmt 1 1 +> assertEqual "testSelectDouble: 1.2" 1.2 n +> stmtFinalise stmt + +> testSelectDate db = do +> sn <- printPropagateError $ stmtPrepare db "" +> ("select timestamp with time zone '2000-01-01'" +> ++ " union select timestamp with time zone '2001-01-01'" +> ++ " union select timestamp with time zone '1999-01-01' order by 1" +> ) +> [] +> let +> d1 = UTCTime (fromGregorian 1999 1 1) 0 +> d0 = UTCTime (fromGregorian 2000 1 1) 0 +> d2 = UTCTime (fromGregorian 2001 1 1) 0 +> diff1 = realToFrac (diffUTCTime d1 d0) +> diff2 = realToFrac (diffUTCTime d2 d0) +> (stmt,ntuples) <- stmtExec0t db sn +> d <- colValUTCTime stmt 1 1 +> assertEqual "testSelectDate: 1999" d1 d +> d <- colValUTCTime stmt 2 1 +> assertEqual "testSelectDate: 2000" d0 d +> d <- colValUTCTime stmt 3 1 +> assertEqual "testSelectDate: 2001" d2 d +> stmtFinalise stmt + + +Here we test some wierd date boundary cases in Postgres. +There's some funnyness around 1916-10-01 02:25:20 when we use time zones. + +testSelectDate2: 1, -2627156078 +testSelectDate2: 2, -2627156079 +testSelectDate2: 3, -2627156080 (without time zone) +testSelectDate2: 4, -2627158159 (with time zone) +diff 3-4: 2080 seconds = 00:34:40 + +-- Update: + +Turns out this is due to my default timezone, which was set to Europe/Dublin +(some odd things happened to Irish timekeeping at 1916-10-01 02:25:20). + +Setting it to GMT (rather than Europe/London or Europe/Dublin) fixed it. +Note that Europe/London also has some funnyness in 1847, +so it's also a poor choice if we want to test boundary dates. + + +> testSelectDate2 db = do +> let +> sqltext = "select timestamp without time zone '1916-10-01 02:25:22', 10" +> ++ " union select timestamp without time zone '1916-10-01 02:25:21', 20" +> ++ " union select timestamp without time zone '1916-10-01 02:25:20', 30" +> ++ " union select timestamp with time zone '1916-10-01 02:25:20' /* this one fails */, 40" +> ++ " order by 2" +> sn <- printPropagateError $ stmtPrepare db "" sqltext [] +> let +> ds = ( +> mkUTCTime 1916 10 1 2 25 22: +> mkUTCTime 1916 10 1 2 25 21: +> mkUTCTime 1916 10 1 2 25 20: +> mkUTCTime 1916 10 1 2 25 20: +> [] ) +> (stmt,ntuples) <- stmtExec0t db sn +> let +> loop n = +> if n <= ntuples +> then do +> x <- colValDouble stmt n 1 +> d <- colValUTCTime stmt n 1 +> assertEqual ("testSelectDate2: " ++ show n ++ "\n" ++ sqltext) (ds!!(n-1)) d +> loop (n+1) +> else return () +> loop 1 +> stmtFinalise stmt + + +Postgres only allows specification of -ve years by use of the AD/BC suffix. +Sadly, this differs from the astronomical year number like so: +astro: ... 3, 2, 1, 0, -1, -2, -3,... +ad/bc: ...3AD,2AD,1AD,1BC,2BC,3BC,4BC,... + +i.e. 0 astro = 1BC, -1 astro = 2BC, etc. + +ISO8601 uses astronomical years, so we ought to be able to write +-1000-12-25 (instead of 1001-01-01 BC), but Postgres won't parse this. + +> testSelectDate3 db = do +> let +> sqltext = "select timestamp without time zone '1900-01-01', 10" +> ++ " union select timestamp without time zone '1000-01-01', 20" +> ++ " union select timestamp without time zone '0001-01-01', 30" +> ++ " union select timestamp without time zone '1001-01-01 BC', 40" +> ++ " order by 2" +> sn <- printPropagateError $ stmtPrepare db "" sqltext [] +> let +> ds = +> mkUTCTime 1900 1 1 0 0 0 : +> mkUTCTime 1000 1 1 0 0 0 : +> mkUTCTime 0001 1 1 0 0 0 : +> mkUTCTime (-1000) 1 1 0 0 0 : +> [] +> (stmt,ntuples) <- stmtExec0t db sn +> let +> loop n = +> if n <= ntuples +> then do +> --x <- colValDouble stmt n 1 +> d <- colValUTCTime stmt n 1 +> assertEqual ("testSelectDate3: " ++ show n ++ "\n" ++ sqltext) (ds!!(n-1)) d +> loop (n+1) +> else return () +> loop 1 +> stmtFinalise stmt + + +If we don't specify the type, Postgres gives the number the NUMERIC type. +I don't yet know what the internal binary rep is, nor how to +convert it to an appropriate Haskell type. +Best we can do is marshal/transmist everything as text. + +> testSelectNumeric db = do +> sn <- printPropagateError $ stmtPrepare db "" "select 1.2" [] +> (rs,ntuples) <- stmtExec0t db sn +> --fmt0 <- fPQfformat rs 0 +> --ct0 <- fPQftype rs 0 +> --putStrLn $ "\ntestSelectNumeric: format " ++ (show fmt0) ++ ", type (oid) " ++ (show ct0) +> n <- colValDouble rs 1 1 +> assertEqual "testSelectNumeric: 1.2" 1.2 n +> stmtFinalise rs + + + +> testUnion db = do +> (stmt,ntuples) <- printPropagateError $ +> stmtExecImm db "select 'h1' from tdual union select 'h2' from tdual union select 'h3' from tdual" [] +> assertEqual "testUnion: ntuples" 3 ntuples +> s <- colValString stmt 1 1 +> assertEqual "testUnion: h1" "h1" s +> s <- colValString stmt 2 1 +> assertEqual "testUnion: h2" "h2" s +> s <- colValString stmt 3 1 +> assertEqual "testUnion: h3" "h3" s +> stmtFinalise stmt + + +> testSelectNoRows db = do +> (stmt,ntuples) <- printPropagateError $ +> stmtExecImm db "select 'h1' from tdual where dummy = '2'" [] +> stmtFinalise stmt +> assertEqual "testSelectNoRows: done" 0 ntuples + + +> manyRows :: String +> manyRows = +> "select 1 from" +> ++ " ( select 1 from tdual union select 0 from tdual) as t1" +> ++ ", ( select 2 from tdual union select 0 from tdual) as t2" +> ++ ", ( select 3 from tdual union select 0 from tdual) as t3" +> ++ ", ( select 4 from tdual union select 0 from tdual) as t4" +> ++ ", ( select 5 from tdual union select 0 from tdual) as t5" +> ++ ", ( select 6 from tdual union select 0 from tdual) as t6" +> ++ ", ( select 7 from tdual union select 0 from tdual) as t7" +> ++ ", ( select 8 from tdual union select 0 from tdual) as t8" +> ++ ", ( select 9 from tdual union select 0 from tdual) as t9" +> ++ ", ( select 10 from tdual union select 0 from tdual) as t10" + + +> countRows :: DBHandle -> String -> Int -> IO Int +> countRows db sn n = do +> (stmt,ntuples) <- printPropagateError $ stmtExec0t db sn +> stmtFinalise stmt +> if ntuples == 0 +> then return n +> else countRows db sn (n+ntuples) + +> cursor'name = "takusenp" + +> testSelectManyRows db = do +> let prefetch = 200 +> _ <- printPropagateError $ nqExec db "Begin work" +> let q = "DECLARE " ++ cursor'name ++ " NO SCROLL CURSOR FOR " ++ +> manyRows +> _ <- printPropagateError $ nqExec db q +> let f = "FETCH FORWARD " ++ (show prefetch) ++ " FROM " ++ cursor'name +> sn <- printPropagateError $ stmtPrepare db "" f [] +> n <- countRows db sn 0 +> _ <- printPropagateError $ nqExec db $ "CLOSE " ++ cursor'name +> _ <- printPropagateError $ nqExec db $ "commit work" +> assertEqual "testSelectManyRows: done" 1024 n + + +> testBindString db = do +> (rs, ntuples) <- printPropagateError $ +> prepare'n'exec db "" (substituteBindPlaceHolders "select ?") [newBindVal "h1"] +> n <- colValString rs 1 1 +> assertEqual "testBindString: h1" "h1" n +> stmtFinalise rs + +> testBindInt db = do +> (rs, ntuples) <- printPropagateError $ +> prepare'n'exec db "" (substituteBindPlaceHolders "select ?") [newBindVal (2001::Int)] +> n <- colValInt rs 1 1 +> assertEqual "testBindInt: 2001" 2001 n +> stmtFinalise rs + +> testBindDouble db = do +> let +> v1 :: Double; v1 = 2.3 +> v2 :: Int; v2 = 2001 +> v3 :: Int; v3 = 2001 +> bindvals = [newBindVal v1, newBindVal v2, newBindVal v3] +> (rs, ntuples) <- printPropagateError $ do +> prepare'n'exec db "" (substituteBindPlaceHolders "select ? from tdual where ? = ?") bindvals +> n <- colValDouble rs 1 1 +> assertEqual "testBindDouble: 2.3" 2.3 n +> stmtFinalise rs + +> testBindDate db = do +> let +> v1 :: UTCTime; v1 = UTCTime (fromGregorian 2000 1 1) 0 +> v2 :: UTCTime; v2 = UTCTime (fromGregorian 1980 2 29) 0 +> bindvals = [newBindVal v1, newBindVal v2] +> (rs, ntuples) <- printPropagateError $ +> prepare'n'exec db "" (substituteBindPlaceHolders "select ?, ?") bindvals +> n <- colValUTCTime rs 1 1 +> assertEqual "testBindDate: 1 " v1 n +> n <- colValUTCTime rs 1 2 +> assertEqual "testBindDate: 2 " v2 n +> stmtFinalise rs + +> testSelectUTF8Text db = do +> -- GREEK SMALL LETTER PHI +> -- unicode code-point 966 +> -- UTF8: CF86 (207,134) +> -- UTF16: 03C6 +> let expect = ['\966'] +> let sql = "select '" ++ expect ++ "'" +> sn <- printPropagateError (stmtPrepare db "" sql []) +> (stmt,ntuples) <- stmtExec0t db sn +> assertEqual "testSelectUTF8Text: ntuples" 1 ntuples +> result <- colValString stmt 1 1 +> assertEqual "testSelectUTF8Text" expect result +
+ Database/PostgreSQL/Test/pgaccess.hs view
@@ -0,0 +1,188 @@+{-# OPTIONS -fglasgow-exts #-}++module Main where++import System.Environment (getArgs)+import Control.Exception (try, handle, bracket, throwIO)+import System.IO+import Data.List (isPrefixOf)+import Data.Char (toLower)+import System.Posix (epochTime,ProcessID,getProcessID,EpochTime)+import Database.PostgreSQL.PGFunctions+import Prelude hiding (log)++docstrings = [+ "A helper to access a PostgreSQL from a `scripting' language.",+ "This function attempts to closely emulate `dbaccess' of Informix.",+ "The goal is to have my Scheme-to-Informix interface work with",+ "PostgreSQL with minimal changes.",+ "",+ "Synopsys:",+ " dbaccess <conn-parms>",+ "where <conn-parms> is the string of database connection parameters.",+ "",+ "The program connects to the database and listens on its standard",+ "input for a SQL command. A command is an ASCII sequence terminated by",+ "NL-NULL-NL.",+ "If the command is other than SELECT or COPY, we submit it to the database.",+ "On success, no reply is generated, and we wait for a new command.",+ "If the command starts with a /*simple*/ SELECT, we expect few rows.",+ "We submit the query to the database and write the result to stdout.",+ "If the command was SELECT, we make a query and write the result,",+ "in groups, to the stdout. Each group of results has the form:",+ " 0 NL",+ " for the last group of results",+ " <nrows> <space> <ncols> NL",+ " followed by the matrix of <nrows> * <ncols> field values in the",+ " row-major order. Each field value has the form",+ " <length>NL<value>",+ " where <length> is the length of the value proper (no NL).",+ "",+ "If the command was COPY, we assume ",+ " COPY /*<len> fname*/ table ... FROM STDIN...",+ " where <len> is the length of the file name. We open the file and",+ " send its contents to the server",+ "",+ "Any error causes the termination of this program.",+ "We log all the results to stderr."+ ]+++main = do+ args <- getArgs+ hSetBuffering stderr LineBuffering+ hSetBuffering stdout LineBuffering+ case args of+ [connparms] -> main' connparms+ _ -> mapM_ err'note ("One argument is expected" :+ docstrings)++err'note = hPutStrLn stderr++data Log = Log { log_pid :: ProcessID, log_time :: EpochTime }++log log_data strs = err'note (show (log_time log_data) +++ " [" ++ show (log_pid log_data) ++ "] " +++ concat strs)++main' connparms =+ do+ pid <- getProcessID+ etime <- epochTime+ let logd = Log pid etime+ catchPG (+ bracket (openDb connparms) closeDb $ \db ->+ log logd ["Starting"] >>+ -- setErrorVerbosity db ePQERRORS_VERBOSE+ main'' logd stdin db stdout)+ (\e -> err'note (show e) >> rethrowPG e)+++data CommandCategory = + CmdQuery | CmdSimpleQuery String | CmdCopy FilePath String | CmdOther++-- Main loop proper+main'' logd hin db hout =+ do+ cmd <- get'command hin ""+ logd <- epochTime >>= (\et -> return logd{log_time=et})+ log logd ["SQL: ",cmd]+ case classify cmd of+ CmdQuery -> exec'complex'query logd cmd db hout+ CmdSimpleQuery cmd -> + exec'simple'query logd cmd db hout+ CmdOther -> exec'other logd cmd db hout+ CmdCopy fname cmd -> exec'copy logd cmd db fname+ hFlush hout+ main'' logd hin db hout+ where+ get'command hin acc = do + s <- hGetLine hin+ if s == "\NUL" then return acc + else get'command hin (acc ++ s ++ "\n")+ psimple = "/*simple*/"+ classify cmd | isPrefixOf psimple cmd = CmdSimpleQuery + (drop (length psimple) cmd)+ classify cmd | isPrefixOfci "select" cmd = CmdQuery+ classify cmd | isPrefixOfci "copy" cmd = + let (fname,s) = read'fname $ snd (break (== '/') cmd)+ in CmdCopy fname ("copy " ++ s)+ classify _ = CmdOther++ read'fname ('/':'*':str) = let [(l::Int,' ':s)] = reads str+ fname = take l s+ ('*':'/':s') = drop l s+ in (fname,s')++ -- case-insensitive+ isPrefixOfci [] _ = True+ isPrefixOfci _ [] = False+ isPrefixOfci (cp:rp) (cs:rs) | (toLower cp == toLower cs) =+ isPrefixOfci rp rs+ isPrefixOfci _ _ = False+++-- ------------------------------------------------------------------------+-- Executors++nrows_in_a_group = 10 -- aka, the prefetch count+cursor_name = "pgaccessc"++-- A general query: may return too many rows. So, we have to open+-- a cursor and query by groups+exec'complex'query logd cmd db hout = + do+ nqExec db $ unwords ["DECLARE",cursor_name,"NO SCROLL CURSOR FOR",cmd]+ let fetchq = unwords ["FETCH FORWARD",show nrows_in_a_group,"FROM",+ cursor_name]+ psname <- stmtPrepare db "" fetchq []+ let loop = do+ (rs,ntuples) <- stmtExec0t db psname+ log logd ["SQLtuples...: ",show ntuples]+ put'tuples rs ntuples hout+ stmtFinalise rs+ if ntuples == 0 then return () else loop+ loop+ nqExec db $ unwords ["CLOSE",cursor_name]+ return ()++++-- execute a query that is expected to produce few values.+-- That is, we're justified in asking for all tuples and so can get+-- by without opening a cursor, etc.+exec'simple'query logd cmd db hout = + do+ (rs,ntuples) <- stmtExecImm0 db cmd+ log logd ["SQLtuples: ",show ntuples]+ put'tuples rs ntuples hout+ stmtFinalise rs++put'tuples rs ntuples hout =+ if ntuples == 0 then hPutStrLn hout "0" else put'tuples'+ where+ put'tuples' = do+ ncols <- fPQnfields rs+ hPutStrLn hout $ unwords [show ntuples,show ncols]+ sequence_ [put'col i j | i<-[0..ntuples-1], j<-[0..ncols-1]]+ put'col i j = do+ len <- fPQgetlength rs (fromIntegral i) (fromIntegral j)+ hPutStrLn hout $ show len+ vp <- fPQgetvalue rs (fromIntegral i) (fromIntegral j)+ hPutBuf hout vp (fromIntegral len)+++-- Execute command (such as DDL or DML) that produces no resultset+exec'other logd cmd db hout = + do+ res <- nqExec db cmd+ log logd ["SQLDone: ", show res]++-- Execute the COPY FROM STDIN command+exec'copy logd cmd db fname = + do+ log logd ["SQLCopy: ", fname]+ hin <- openBinaryFile fname ReadMode+ nqCopyIn db cmd hin+ hClose hin+ log logd ["SQLCopyDone"]
+ Database/Sqlite/Enumerator.lhs view
@@ -0,0 +1,462 @@+ +| +Module : Database.Sqlite.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Sqlite implementation of Database.Enumerator. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-undecidable-instances #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Sqlite.Enumerator +> ( Session, connect +> , prepareStmt, preparePrefetch +> , prepareQuery, prepareLargeQuery, prepareCommand +> , sql, sqlbind, prefetch, cmdbind +> , LastInsertRowid(..) +> , module Database.Enumerator +> ) +> where + + +> import Data.Int ( Int64 ) +> import Database.Enumerator +> import Database.InternalEnumerator +> import Database.Util +> import Foreign.C +> import Control.Monad +> import Control.Exception +> import Database.Sqlite.SqliteFunctions +> (DBHandle, StmtHandle, SqliteException(..), catchSqlite, throwSqlite) +> import qualified Database.Sqlite.SqliteFunctions as DBAPI +> import Control.Monad.Trans +> import Control.Monad.Reader +> import Data.Dynamic +> import Data.IORef +> import Data.Int +> import System.Time +> import Data.Time + + +> {-# DEPRECATED prepareStmt "Use prepareQuery or prepareCommand instead" #-} +> {-# DEPRECATED preparePrefetch "Use prepareLargeQuery instead" #-} + +-------------------------------------------------------------------- +-- ** API Wrappers +-------------------------------------------------------------------- + +|These wrappers ensure that only DBExceptions are thrown, +and never SqliteExceptions. +We don't need wrappers for the colValXxx functions +because they never throw exceptions. + + +> convertAndRethrow :: SqliteException -> IO a +> convertAndRethrow (SqliteException e m) = do +> let +> s@(ssc,sssc) = errorSqlState e +> ec = case ssc of +> "XX" -> DBFatal +> "58" -> DBFatal +> "57" -> DBFatal +> "54" -> DBFatal +> "53" -> DBFatal +> "08" -> DBFatal +> _ -> DBError +> throwDB (ec s e m) + +Below are pretty much all of the errors that Sqlite can throw. + +> errorSqlState :: Int -> (String, String) +> errorSqlState 0 = ("00", "000") +> errorSqlState 1 = ("42", "000") -- sql error or missing database +> errorSqlState 2 = ("XX", "000") -- internal error +> errorSqlState 3 = ("42", "501") -- insufficient privileges/permission denied +> errorSqlState 4 = ("38", "000") -- callback requested abort +> errorSqlState 5 = ("58", "030") -- database file locked +> errorSqlState 6 = ("55", "006") -- table locked +> errorSqlState 7 = ("53", "200") -- malloc failed +> errorSqlState 8 = ("25", "006") -- can't write readonly database +> errorSqlState 9 = ("57", "014") -- query cancelled (interrupt) +> errorSqlState 10 = ("58", "030") -- io error +> errorSqlState 11 = ("58", "030") -- corrupt file +> errorSqlState 12 = ("42", "704") -- internal: object not found +> errorSqlState 13 = ("53", "100") -- database full +> errorSqlState 14 = ("58", "030") -- can't open database file +> errorSqlState 15 = ("55", "000") -- lock protocol error +> errorSqlState 16 = ("22", "000") -- internal: empty table +> errorSqlState 17 = ("42", "000") -- schema changed +> errorSqlState 18 = ("54", "000") -- row too big +> errorSqlState 19 = ("23", "000") -- constraint violation +> errorSqlState 20 = ("42", "804") -- data type mismatch +> errorSqlState 21 = ("39", "000") -- library used incorrectly +> errorSqlState 22 = ("58", "030") -- unsupported OS feature on host +> errorSqlState 23 = ("42", "501") -- authorisation denied +> errorSqlState 100 = ("00", "000") -- next row ready +> errorSqlState 101 = ("00", "000") -- end of fetch +> errorSqlState _ = ("01", "000") -- unspecified error + + +|Common case: wrap an action with a convertAndRethrow. + +> convertEx :: IO a -> IO a +> convertEx action = catchSqlite action convertAndRethrow + +> stmtPrepare :: DBHandle -> String -> IO StmtHandle +> stmtPrepare db sqltext = convertEx $ DBAPI.stmtPrepare db sqltext + +> fetchRow :: DBHandle -> StmtHandle -> IO CInt +> fetchRow db stmt = convertEx $ DBAPI.stmtFetch db stmt + +> resetStmt :: DBHandle -> StmtHandle -> IO () +> resetStmt db stmt = convertEx $ DBAPI.stmtReset db stmt + +> finaliseStmt :: DBHandle -> StmtHandle -> IO () +> finaliseStmt db stmt = convertEx $ DBAPI.stmtFinalise db stmt + +> openDb dbname = convertEx $ DBAPI.openDb dbname +> closeDb handle = convertEx $ DBAPI.closeDb handle + +-------------------------------------------------------------------- +-- ** Sessions +-------------------------------------------------------------------- + +We don't need much in an Sqlite Session record. +Session objects are created by 'connect'. + +> newtype Session = Session { dbHandle :: DBHandle } deriving Typeable + +> connect :: String -> ConnectA Session +> connect dbname = ConnectA $ do +> db <- openDb dbname +> return (Session db) + +> lastInsertRowid :: Session -> IO Int64 +> lastInsertRowid sess = +> liftM fromIntegral $! DBAPI.sqliteLastInsertRowid (dbHandle sess) + +-------------------------------------------------------------------- +-- Statements and Commands +-------------------------------------------------------------------- + +> newtype QueryString = QueryString String + +> sql :: String -> QueryString +> sql str = QueryString str + +> instance Command QueryString Session where +> executeCommand sess (QueryString str) = executeCommand sess str + +> instance Command String Session where +> executeCommand sess str = do +> stmt <- stmtPrepare (dbHandle sess) str +> fetchRow (dbHandle sess) stmt +> n <- DBAPI.stmtChanges (dbHandle sess) +> finaliseStmt (dbHandle sess) stmt +> return (fromIntegral n) + +> instance Command BoundStmt Session where +> executeCommand sess (BoundStmt pstmt) = do +> fetchRow (dbHandle sess) (stmtHandle pstmt) +> n <- DBAPI.stmtChanges (dbHandle sess) +> return (fromIntegral n) + +> instance Command StmtBind Session where +> executeCommand sess (StmtBind sqltext bas) = do +> let (PreparationA action) = prepareStmt' sqltext False +> pstmt <- action sess +> sequence_ (zipWith (\i (BindA ba) -> ba sess pstmt i) [1..] bas) +> fetchRow (dbHandle sess) (stmtHandle pstmt) +> n <- DBAPI.stmtChanges (dbHandle sess) +> finaliseStmt (dbHandle sess) (stmtHandle pstmt) +> return (fromIntegral n) + + +> data LastInsertRowid = LastInsertRowid + +> instance EnvInquiry LastInsertRowid Session Int64 where +> inquire LastInsertRowid sess = +> liftM fromIntegral (DBAPI.sqliteLastInsertRowid (dbHandle sess)) + + +> instance ISession Session where +> disconnect sess = closeDb (dbHandle sess) +> beginTransaction sess isolation = +> executeCommand sess "begin;" >> return () +> commit sess = executeCommand sess "commit;" >> return () +> rollback sess = executeCommand sess "rollback;" >> return () + +About stmtFreeWithQuery: + +We need to keep track of the scope of the PreparedStmtObj +i.e. should it be freed when the Query (result-set) is freed, +or does it have a longer lifetime? +PreparedStmts created by prepareStmt have a lifetime possibly +longer than the result-set; users should use withPreparedStatement +to manage these. + +PreparedStmts can also be created internally by various instances +of makeQuery (in class Statement), and these will usually have the +same lifetime/scope as that of the Query (result-set). + +This lifetime distinction should probably be handled by having +separate types for the two types of prepared statement... + +> data PreparedStmtObj = PreparedStmtObj +> { stmtHandle :: StmtHandle +> , stmtFreeWithQuery :: Bool +> } + +> prepareStmt :: QueryString -> PreparationA Session PreparedStmtObj +> prepareStmt (QueryString sqltext) = prepareStmt' sqltext False + +> prepareQuery :: QueryString -> PreparationA Session PreparedStmtObj +> prepareQuery (QueryString sqltext) = prepareStmt' sqltext False + +> prepareLargeQuery :: Int -> QueryString -> PreparationA Session PreparedStmtObj +> prepareLargeQuery _ (QueryString sqltext) = prepareStmt' sqltext False + +> prepareCommand :: QueryString -> PreparationA Session PreparedStmtObj +> prepareCommand (QueryString sqltext) = prepareStmt' sqltext False + + +preparePrefetch is just here for interface consistency +with Oracle and PostgreSQL. + +> preparePrefetch :: Int -> QueryString -> PreparationA Session PreparedStmtObj +> preparePrefetch count (QueryString sqltext) = +> prepareStmt' sqltext False + +> prepareStmt' sqltext free = +> PreparationA (\sess -> do +> stmt <- stmtPrepare (dbHandle sess) sqltext +> return (PreparedStmtObj stmt free)) + +-------------------------------------------------------------------- +-- ** Binding +-------------------------------------------------------------------- + +> newtype BoundStmt = BoundStmt { boundStmt :: PreparedStmtObj } +> type BindObj = Int -> IO () + +> instance IPrepared PreparedStmtObj Session BoundStmt BindObj where +> bindRun sess stmt bas action = do +> sequence_ (zipWith (\i (BindA ba) -> ba sess stmt i) [1..] bas) +> action (BoundStmt stmt) +> destroyStmt sess stmt = finaliseStmt (dbHandle sess) (stmtHandle stmt) + +> instance DBBind (Maybe String) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe Int) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe Int64) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe Double) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe CalendarTime) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe UTCTime) Session PreparedStmtObj BindObj where +> bindP = makeBindAction + +> instance DBBind (Maybe a) Session PreparedStmtObj BindObj +> => DBBind a Session PreparedStmtObj BindObj where +> bindP x = bindP (Just x) + +The default instance, uses generic Show + +> instance (Show a) => DBBind (Maybe a) Session PreparedStmtObj BindObj where +> bindP (Just x) = bindP (Just (show x)) +> bindP Nothing = bindP (Nothing `asTypeOf` Just "") + +> makeBindAction x = BindA (\ses st -> bindMaybe (dbHandle ses) (stmtHandle st) x) + + +> class SqliteBind a where +> stmtBind :: DBHandle -> StmtHandle -> Int -> a -> IO () + +> instance SqliteBind Int where stmtBind = DBAPI.bindInt +> instance SqliteBind Int64 where stmtBind = DBAPI.bindInt64 +> instance SqliteBind String where stmtBind = DBAPI.bindString +> instance SqliteBind Double where stmtBind = DBAPI.bindDouble +> instance SqliteBind CalendarTime where +> stmtBind db stmt pos val = +> DBAPI.bindInt64 db stmt pos (calTimeToInt64 val) +> instance SqliteBind UTCTime where +> stmtBind db stmt pos val = +> DBAPI.bindInt64 db stmt pos (utcTimeToInt64 val) + +> bindMaybe :: (SqliteBind a) +> => DBHandle -> StmtHandle -> Maybe a -> Int -> IO () +> bindMaybe db stmt mval pos = convertEx $ +> case mval of +> Nothing -> DBAPI.bindNull db stmt pos +> Just val -> stmtBind db stmt pos val + + + +-------------------------------------------------------------------- +-- ** Queries +-------------------------------------------------------------------- + +> data Query = Query +> { queryStmt :: PreparedStmtObj +> , querySess :: Session +> , queryCount :: IORef Int +> } + +> data StmtBind = StmtBind String [BindA Session PreparedStmtObj BindObj] + +> sqlbind :: String -> [BindA Session PreparedStmtObj BindObj] -> StmtBind +> sqlbind sql bas = StmtBind sql bas + +> cmdbind :: String -> [BindA Session PreparedStmtObj BindObj] -> StmtBind +> cmdbind sql bas = StmtBind sql bas + +> prefetch :: Int -> String -> [BindA Session PreparedStmtObj BindObj] -> StmtBind +> prefetch n sql bas = StmtBind sql bas + + +> instance Statement BoundStmt Session Query where +> makeQuery sess bstmt = do +> n <- newIORef 0 +> return (Query (boundStmt bstmt) sess n) + +> instance Statement PreparedStmtObj Session Query where +> makeQuery sess pstmt = do +> n <- newIORef 0 +> return (Query pstmt sess n) + +> instance Statement StmtBind Session Query where +> makeQuery sess (StmtBind sqltext bas) = do +> let (PreparationA action) = prepareStmt' sqltext True +> pstmt <- action sess +> sequence_ (zipWith (\i (BindA ba) -> ba sess pstmt i) [1..] bas) +> n <- newIORef 0 +> return (Query pstmt sess n) + +> instance Statement QueryString Session Query where +> makeQuery sess (QueryString sqltext) = makeQuery sess sqltext + +> instance Statement String Session Query where +> makeQuery sess sqltext = do +> let (PreparationA action) = prepareStmt' sqltext True +> pstmt <- action sess +> n <- newIORef 0 +> return (Query pstmt sess n) + + +> instance IQuery Query Session ColumnBuffer where +> destroyQuery query = +> if (stmtFreeWithQuery (queryStmt query)) +> then finaliseStmt (dbHandle (querySess query)) (stmtHandle (queryStmt query)) +> else resetStmt (dbHandle (querySess query)) (stmtHandle (queryStmt query)) +> fetchOneRow query = do +> rc <- fetchRow (dbHandle (querySess query)) (stmtHandle (queryStmt query)) +> modifyIORef (queryCount query) (+1) +> return (rc /= DBAPI.sqliteDONE) +> currentRowNum q = readIORef (queryCount q) +> freeBuffer q buffer = return () + + +> nullIf :: Bool -> a -> Maybe a +> nullIf test v = if test then Nothing else Just v + +> bufferToString query buffer = +> DBAPI.colValString (stmtHandle (queryStmt query)) (colPos buffer) + +> bufferToInt query buffer = do +> v <- DBAPI.colValInt (stmtHandle (queryStmt query)) (colPos buffer) +> return (Just v) + +> bufferToInt64 query buffer = do +> v <- DBAPI.colValInt64 (stmtHandle (queryStmt query)) (colPos buffer) +> return (Just v) + +> bufferToDouble query buffer = do +> v <- DBAPI.colValDouble (stmtHandle (queryStmt query)) (colPos buffer) +> return (Just v) + +> nullDatetimeInt64 :: Int64 +> nullDatetimeInt64 = 99999999999999 + +> bufferToCalTime query buffer = do +> v <- DBAPI.colValInt64 (stmtHandle (queryStmt query)) (colPos buffer) +> return (nullIf (v == 0 || v == nullDatetimeInt64) (int64ToCalTime v)) + +> bufferToUTCTime query buffer = do +> v <- DBAPI.colValInt64 (stmtHandle (queryStmt query)) (colPos buffer) +> return (nullIf (v == 0 || v == nullDatetimeInt64) (int64ToUTCTime v)) + + +|There aren't really Buffers to speak of with Sqlite, +so we just record the position of each column. +We also keep a reference to the Query which owns the buffer, +as we need it to get column values. + +> data ColumnBuffer = ColumnBuffer +> { colPos :: Int +> , colQuery :: Query +> } + +> allocBuffer q colpos = return $ ColumnBuffer { colPos = colpos, colQuery = q } + +> buffer_pos q buffer = do +> row <- currentRowNum q +> return (row,colPos buffer) + + +> instance DBType (Maybe String) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol q buffer = bufferToString q buffer + +> instance DBType (Maybe Int) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol q buffer = bufferToInt q buffer + +> instance DBType (Maybe Int64) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol q buffer = bufferToInt64 q buffer + +> instance DBType (Maybe Double) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q n +> fetchCol q buffer = bufferToDouble q buffer + +> instance DBType (Maybe CalendarTime) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer undefined n +> fetchCol q buffer = bufferToCalTime q buffer + +> instance DBType (Maybe UTCTime) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer undefined n +> fetchCol q buffer = bufferToUTCTime q buffer + + +|This single polymorphic instance replaces all of the type-specific non-Maybe instances +e.g. String, Int, Double, etc. + +> instance DBType (Maybe a) Query ColumnBuffer +> => DBType a Query ColumnBuffer where +> allocBufferFor _ q n = allocBufferFor (undefined::Maybe a) q n +> fetchCol q buffer = throwIfDBNull (buffer_pos q buffer) (fetchCol q buffer) + + +|This polymorphic instance assumes that the value is in a String column, +and uses Read to convert the String to a Haskell data value. + +> instance (Show a, Read a) => DBType (Maybe a) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer undefined n +> fetchCol q buffer = do +> v <- bufferToString q buffer +> case v of +> Just s -> if s == "" then return Nothing else return (Just (read s)) +> Nothing -> return Nothing
+ Database/Sqlite/SqliteFunctions.lhs view
@@ -0,0 +1,323 @@+> {-# OPTIONS -ffi -fglasgow-exts #-} + +| +Module : Database.Sqlite.SqliteFunctions +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Simple wrappers for Sqlite functions (FFI). + + +> module Database.Sqlite.SqliteFunctions where + +> import Foreign.C.UTF8 +> import Foreign +> import Foreign.C +> import Foreign.Ptr +> import Control.Monad +> import Control.Exception +> import Data.Dynamic +> import Data.Int + + +> data DBHandleStruct = DBHandleStruct +> type DBHandle = Ptr DBHandleStruct +> data StmtStruct = StmtStruct +> type StmtHandle = Ptr StmtStruct +> type Blob = Ptr Word8 + +> type SqliteCallback a = FunPtr (Ptr a -> CInt -> Ptr CString -> Ptr CString -> IO Int) +> type FreeFunPtr = FunPtr ( Ptr Word8 -> IO () ) + +> data SqliteException = SqliteException Int String +> deriving (Typeable) + +> instance Show SqliteException where +> show (SqliteException i s) = "SqliteException " ++ (show i) ++ " " ++ s + +> catchSqlite :: IO a -> (SqliteException -> IO a) -> IO a +> catchSqlite = catchDyn + +> throwSqlite :: SqliteException -> a +> throwSqlite = throwDyn + +> sqliteOK :: CInt +> sqliteOK = 0 +> sqliteERROR :: CInt +> sqliteERROR = 1 +> sqliteROW :: CInt +> sqliteROW = 100 +> sqliteDONE :: CInt +> sqliteDONE = 101 + +> cStr :: CStringLen -> CString +> cStr = fst +> cStrLen :: CStringLen -> CInt +> cStrLen = fromIntegral . snd + +Apparently Sqlite's UTF16 is in "host native byte order", +whatever that means. + +> type UTF16CString = CString +> type UTF8CString = CString + + +> foreign import ccall "sqlite.h sqlite3_open" sqliteOpen +> :: UTF8CString -> Ptr DBHandle -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_close" sqliteClose +> :: DBHandle -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_prepare" sqlitePrepare +> :: DBHandle -> UTF8CString -> CInt -> Ptr StmtHandle -> Ptr CString -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_exec" sqliteExec +> :: DBHandle -> UTF8CString -> SqliteCallback a -> Ptr a -> Ptr CString -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_step" sqliteStep +> :: StmtHandle -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_finalize" sqliteFinalise +> :: StmtHandle -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_reset" sqliteReset +> :: StmtHandle -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_changes" sqliteChanges +> :: DBHandle -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_last_insert_rowid" sqliteLastInsertRowid +> :: DBHandle -> IO CLLong + +> foreign import ccall "sqlite.h sqlite3_free" sqliteFree +> :: Ptr a -> IO () + +> foreign import ccall "sqlite.h sqlite3_errcode" sqliteErrcode +> :: DBHandle -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_errmsg" sqliteErrmsg +> :: DBHandle -> IO UTF8CString + +column_bytes tells us how big a value is in the result set. + * For blobs it's the blob size. + * For strings, the string is converted to UTF-8 and then the size in bytes is given. + * There's a "16" version which converts to UTF-16. The terminating Null isn't counted. + * For ints and doubles the size of the result after conversion to string is returned + (well, we already know how many bytes the raw value requires, don't we?) + +> foreign import ccall "sqlite.h sqlite3_column_bytes" sqliteColumnBytes +> :: StmtHandle -> CInt -> IO Int + +> foreign import ccall "sqlite.h sqlite3_column_blob" sqliteColumnBlob +> :: StmtHandle -> CInt -> IO Blob + +> foreign import ccall "sqlite.h sqlite3_column_double" sqliteColumnDouble +> :: StmtHandle -> CInt -> IO CDouble + +> foreign import ccall "sqlite.h sqlite3_column_int" sqliteColumnInt +> :: StmtHandle -> CInt -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_column_int64" sqliteColumnInt64 +> :: StmtHandle -> CInt -> IO CLLong + +> foreign import ccall "sqlite.h sqlite3_column_text" sqliteColumnText +> :: StmtHandle -> CInt -> IO UTF8CString + +> foreign import ccall "sqlite.h sqlite3_column_text16" sqliteColumnText16 +> :: StmtHandle -> CInt -> IO UTF16CString + + + + +> foreign import ccall "sqlite.h sqlite3_bind_blob" sqliteBindBlob +> :: StmtHandle -> CInt -> Blob -> CInt -> FreeFunPtr -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_bind_double" sqliteBindDouble +> :: StmtHandle -> CInt -> CDouble -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_bind_int" sqliteBindInt +> :: StmtHandle -> CInt -> CInt -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_bind_int64" sqliteBindInt64 +> :: StmtHandle -> CInt -> CLLong -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_bind_null" sqliteBindNull +> :: StmtHandle -> CInt -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_bind_text" sqliteBindText +> :: StmtHandle -> CInt -> UTF8CString -> CInt -> FreeFunPtr -> IO CInt + +> foreign import ccall "sqlite.h sqlite3_bind_text16" sqliteBindText16 +> :: StmtHandle -> CInt -> UTF16CString -> CInt -> FreeFunPtr -> IO CInt + + +------------------------------------------------------------------- + +> getError :: DBHandle -> IO SqliteException +> getError db = do +> errcodec <- sqliteErrcode db +> errmsgc <- sqliteErrmsg db +> errmsg <- peekUTF8String errmsgc +> return $ SqliteException (fromIntegral errcodec) errmsg + +> getAndRaiseError :: Int -> DBHandle -> IO a +> getAndRaiseError rc db = do +> ex@(SqliteException e m) <- getError db +> if e == 0 +> then throwSqlite (SqliteException rc m) +> else throwSqlite ex +> return undefined + +> errorTest :: DBHandle -> CInt -> IO a -> IO a +> errorTest db rc action = do +> case () of +> _ | rc == sqliteOK -> action +> | rc == sqliteDONE -> action +> | rc == sqliteROW -> action +> | otherwise -> getAndRaiseError (fromIntegral rc) db + + +> testForError :: DBHandle -> CInt -> a -> IO a +> testForError db rc retval = errorTest db rc (return retval) + +> testForErrorWithPtr :: (Storable a) => DBHandle -> CInt -> Ptr a -> IO a +> testForErrorWithPtr db rc ptr = errorTest db rc (peek ptr >>= return) + + +> openDb :: String -> IO DBHandle +> openDb dbName = +> withUTF8String dbName $ \cstr -> +> alloca $ \dbptr -> do +> rc <- sqliteOpen cstr dbptr +> if dbptr == nullPtr +> then do +> throwSqlite (SqliteException (fromIntegral rc) "Null handle returned when opening database") +> return undefined +> else do +> db <- peek dbptr +> if rc == sqliteOK +> then return db +> else do +> ex <- getError db +> _ <- sqliteClose db +> throwSqlite ex +> return undefined + +> closeDb :: DBHandle -> IO () +> closeDb db = do +> rc <- sqliteClose db +> testForError db rc () + + +| This function is not used internally, so it's only provided +as a user convenience. + +> stmtExec :: DBHandle -> String -> IO Int +> stmtExec db sqlText = +> withUTF8String sqlText $ \cstr -> do +> rc <- sqliteExec db cstr nullFunPtr nullPtr nullPtr +> rows <- sqliteChanges db +> testForError db rc (fromIntegral rows) + +> stmtChanges :: DBHandle -> IO Int +> stmtChanges db = do +> rows <- sqliteChanges db +> return (fromIntegral rows) + +> stmtPrepare :: DBHandle -> String -> IO StmtHandle +> stmtPrepare db sqlText = +> withUTF8StringLen sqlText $ \(cstr, clen) -> +> alloca $ \stmtptr -> +> alloca $ \unusedptr -> do +> rc <- sqlitePrepare db cstr (fromIntegral clen) stmtptr unusedptr +> testForErrorWithPtr db rc stmtptr + +> stmtFetch :: DBHandle -> StmtHandle -> IO CInt +> stmtFetch db stmt = do +> rc <- sqliteStep stmt +> testForError db rc rc + +> stmtFinalise :: DBHandle -> StmtHandle -> IO () +> stmtFinalise db stmt = do +> rc <- sqliteFinalise stmt +> testForError db rc () + +> stmtReset :: DBHandle -> StmtHandle -> IO () +> stmtReset db stmt = do +> rc <- sqliteReset stmt +> testForError db rc () + + +|Column numbers are zero-indexed, so subtract one +from given index (we present a one-indexed interface). + +> colValInt :: StmtHandle -> Int -> IO Int +> colValInt stmt colnum = do +> cint <- sqliteColumnInt stmt (fromIntegral (colnum - 1)) +> return (fromIntegral cint) + +> colValInt64 :: StmtHandle -> Int -> IO Int64 +> colValInt64 stmt colnum = do +> cllong <- sqliteColumnInt64 stmt (fromIntegral (colnum - 1)) +> return (fromIntegral cllong) + +> colValDouble :: StmtHandle -> Int -> IO Double +> colValDouble stmt colnum = do +> cdbl <- sqliteColumnDouble stmt (fromIntegral (colnum - 1)) +> return (realToFrac cdbl) + +> colValString :: StmtHandle -> Int -> IO (Maybe String) +> colValString stmt colnum = do +> cstrptr <- sqliteColumnText stmt (fromIntegral (colnum - 1)) +> if cstrptr == nullPtr +> then return Nothing +> else do +> str <- peekUTF8String cstrptr +> return (Just str) + +> colValBlob :: StmtHandle -> Int -> IO (ForeignPtr Blob) +> colValBlob stmt colnum = do +> let ccolnum = fromIntegral (colnum - 1) +> bytes <- sqliteColumnBytes stmt ccolnum +> src <- sqliteColumnBlob stmt ccolnum +> buffer <- mallocForeignPtrBytes bytes +> withForeignPtr buffer $ \dest -> copyBytes dest src bytes +> return (castForeignPtr buffer) + + +Unlike column numbers, bind positions are 1-indexed, +so there's no need to subtract one from the given position. + +> bindDouble :: DBHandle -> StmtHandle -> Int -> Double -> IO () +> bindDouble db stmt pos value = do +> rc <- sqliteBindDouble stmt (fromIntegral pos) (realToFrac value) +> testForError db rc () + +> bindInt :: DBHandle -> StmtHandle -> Int -> Int -> IO () +> bindInt db stmt pos value = do +> rc <- sqliteBindInt stmt (fromIntegral pos) (fromIntegral value) +> testForError db rc () + +> bindInt64 :: DBHandle -> StmtHandle -> Int -> Int64 -> IO () +> bindInt64 db stmt pos value = do +> rc <- sqliteBindInt64 stmt (fromIntegral pos) (fromIntegral value) +> testForError db rc () + +> bindNull :: DBHandle -> StmtHandle -> Int -> IO () +> bindNull db stmt pos = do +> rc <- sqliteBindNull stmt (fromIntegral pos) +> testForError db rc () + +> bindString :: DBHandle -> StmtHandle -> Int -> String -> IO () +> bindString db stmt pos value = +> withUTF8StringLen value $ \(cstr, clen) -> do +> rc <- sqliteBindText stmt (fromIntegral pos) cstr (fromIntegral clen) nullFunPtr +> testForError db rc () + +> bindBlob :: DBHandle -> StmtHandle -> Int -> Blob -> Int -> IO () +> bindBlob db stmt pos value size = do +> rc <- sqliteBindBlob stmt (fromIntegral pos) value (fromIntegral size) nullFunPtr +> testForError db rc ()
+ Database/Sqlite/Test/Enumerator.lhs view
@@ -0,0 +1,159 @@+ +| +Module : Database.Sqlite.Test.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Sqlite.Test.Enumerator (runTest) where + +> import qualified Database.Sqlite.Test.SqliteFunctions as Low +> import Database.Sqlite.Enumerator +> import Database.Test.Performance as Perf +> import Database.Test.Enumerator +> import Control.Monad (when) +> import Control.Monad.Trans (liftIO) +> import Control.Exception (throwDyn) +> import Test.MiniUnit +> import Data.Int +> import System.Time + + +> runTest :: Perf.ShouldRunTests -> [String] -> IO () +> runTest runPerf args = do +> let (user:pswd:dbname:_) = args +> Low.runTest dbname +> flip catchDB basicDBExceptionReporter $ do +> (r, conn1) <- withContinuedSession (connect dbname) (testBody runPerf) +> withSession conn1 testPartTwo + +> testBody runPerf = do +> runFixture SqliteFunctions +> when (runPerf == Perf.RunTests) runPerformanceTests + +> testPartTwo :: DBM mark Session () +> testPartTwo = do +> makeFixture execDrop execDDL_ +> destroyFixture execDDL_ + +> runPerformanceTests = do +> makeFixture execDrop execDDL_ +> beginTransaction RepeatableRead +> {-# SCC "runPerformanceTests:runTestTT" #-} +> runTestTT "Sqlite performance tests" (map (flip catchDB reportRethrow) +> [ timedSelect (prefetch 1000 sqlRows2Power20 []) 35 (2^20) +> , timedSelect (prefetch 1 sqlRows2Power17 []) 4 (2^17) +> , timedSelect (prefetch 1000 sqlRows2Power17 []) 4 (2^17) +> , timedCursor (prefetch 1 sqlRows2Power17 []) 4 (2^17) +> , timedCursor (prefetch 1000 sqlRows2Power17 []) 4 (2^17) +> ] +> ) +> commit +> destroyFixture execDDL_ + + +> runFixture :: DBLiteralValue a => a -> DBM mark Session () +> runFixture fns = do +> makeFixture execDrop execDDL_ +> runTestTT "Sqlite tests" (map (runOneTest fns) testList) +> destroyFixture execDDL_ + +> runOneTest fns t = catchDB (t fns) reportRethrow + +----------------------------------------------------------- + +> selectNoRows _ = selectTest sqlNoRows iterNoRows expectNoRows + +> selectTerminatesEarly _ = selectTest sqlTermEarly iterTermEarly expectTermEarly + +> selectFloatsAndInts fns = selectTest (sqlFloatsAndInts fns) iterFloatsAndInts expectFloatsAndInts + +> selectNullString _ = selectTest sqlNullString iterNullString expectNullString + +> selectEmptyString _ = selectTest sqlEmptyString iterEmptyString expectEmptyString + +> selectUnhandledNull _ = catchDB ( do +> selectTest sqlUnhandledNull iterUnhandledNull expectUnhandledNull +> assertFailure sqlUnhandledNull +> ) (\e -> return () ) + + + +> selectNullDate dateFn = selectTest (sqlNullDate dateFn) iterNullDate expectNullDate + +> selectDate dateFn = selectTest (sqlDate dateFn) iterDate expectDate + +> selectCalDate dateFn = selectTest (sqlDate dateFn) iterCalDate expectCalDate + +> selectBoundaryDates dateFn = selectTest (sqlBoundaryDates dateFn) iterBoundaryDates expectBoundaryDates + +> selectCursor fns = actionCursor (sqlCursor fns) +> selectExhaustCursor fns = actionExhaustCursor (sqlCursor fns) + +> selectBindString _ = actionBindString +> (prepareQuery (sql sqlBindString)) +> [bindP "a2", bindP "b1"] + +> selectBindInt _ = actionBindInt +> (prepareQuery (sql sqlBindInt)) +> [bindP (1::Int), bindP (2::Int)] + + +> selectBindIntDoubleString _ = actionBindIntDoubleString +> (prefetch 1 sqlBindIntDoubleString [bindP (1::Int), bindP (2.2::Double), bindP "row 1", bindP (3::Int), bindP (4.4::Double), bindP "row 2"]) + +> selectBindDate _ = actionBindDate +> (prefetch 1 sqlBindDate (map bindP expectBindDate)) + +> selectBindBoundaryDates _ = actionBindBoundaryDates +> (prefetch 1 sqlBindBoundaryDates (map bindP expectBoundaryDates)) + +> selectRebindStmt _ = actionRebind (prepareQuery (sql sqlRebind)) +> [bindP (1::Int)] [bindP (2::Int)] + +> boundStmtDML _ = actionBoundStmtDML (prepareCommand (sql sqlBoundStmtDML)) +> boundStmtDML2 _ = do +> -- cannot use withTransaction with rollback/commit; +> -- if you explicitly end the transaction, then when withTransaction +> -- attempts to end it (with a commit, in the success case) then we +> -- get a "logic error". +> -- This differs from PostgreSQL and Oracle, who don't seem to care if +> -- you commit or rollback too many times. +> beginTransaction RepeatableRead +> count <- execDML (cmdbind sqlBoundStmtDML [bindP (100::Int), bindP "100"]) +> rollback +> assertEqual sqlBoundStmtDML 1 count + +> polymorphicFetchTest _ = actionPolymorphicFetch +> (prefetch 1 sqlPolymorphicFetch [bindP expectPolymorphicFetch]) + +> polymorphicFetchTestNull _ = actionPolymorphicFetchNull +> (prefetch 1 sqlPolymorphicFetchNull []) + +> exceptionRollback _ = actionExceptionRollback sqlInsertTest4 sqlExceptionRollback + +> insertGetRowId _ = +> withTransaction RepeatableRead ( do +> execDML (sql ("insert into " ++ testTable ++ " values (100, '100')")) +> rowid <- inquire LastInsertRowid +> liftIO $ putStrLn ("last insert row id " ++ show rowid) +> ) + +> testList :: DBLiteralValue a => [a -> DBM mark Session ()] +> testList = +> [ selectNoRows, selectTerminatesEarly, selectFloatsAndInts +> , selectNullString, selectEmptyString, selectUnhandledNull +> , selectNullDate, selectDate, selectCalDate, selectBoundaryDates +> , selectCursor, selectExhaustCursor +> , selectBindString, selectBindInt, selectBindIntDoubleString +> , selectBindDate, selectBindBoundaryDates, selectRebindStmt +> , boundStmtDML, boundStmtDML2 +> , polymorphicFetchTest, polymorphicFetchTestNull, exceptionRollback +> , insertGetRowId +> ]
+ Database/Sqlite/Test/SqliteFunctions.lhs view
@@ -0,0 +1,293 @@+ +| +Module : Database.Sqlite.Test.SqliteFunctions +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + + +> {-# OPTIONS -fglasgow-exts #-} + +> module Database.Sqlite.Test.SqliteFunctions (runTest) where + + +> import Foreign +> import Foreign.C +> import Foreign.C.UTF8 +> import Control.Monad +> import Control.Exception +> import Data.Dynamic +> import Database.Sqlite.SqliteFunctions +> import System.Environment (getArgs) +> import Test.MiniUnit + + + + +> runTest :: String -> IO () +> runTest dbname = do +> testOpen dbname +> db <- openDb dbname +> createFixture db +> runTestTT "Sqlite low-level tests" (testlist db) +> destroyFixture db +> closeDb db + + +> --testlist db = TestList $ map (\t -> TestCase (t db)) +> testlist db = map (\t -> t db) +> [ testSelectInts +> , testSelectDouble +> , testSelectInt64 +> , testSelectStringNull +> , testSelectStringEmpty +> , testSelectNoRows +> , testSelectManyRows +> , testUnion +> , testBindString +> , testBindDouble +> , testFetchAfterFinalise +> , testConstraintError +> , testSelectUTF8Text +> ] + + +> ignoreError action = +> catchSqlite action (\e -> return undefined) + +> printIgnoreError action = catchSqlite action +> (\e -> do +> putStrLn (show e) +> return undefined +> ) + +> printPropagateError action = catchSqlite action +> (\e -> do +> putStrLn (show e) +> throwSqlite e +> return undefined +> ) + +> ddlExec db stmt = do +> _ <- stmtExec db stmt +> return () + +> testOpen dbname = do +> h <- openDb dbname +> closeDb h + +> createFixture db = do +> ignoreError $ ddlExec db "drop table tdual" +> ignoreError $ ddlExec db "drop table t_natural" +> ignoreError $ ddlExec db "drop table t_blob" +> printPropagateError $ +> ddlExec db "create table tdual (dummy text)" +> printPropagateError $ +> ddlExec db "insert into tdual (dummy) values ('X')" +> printPropagateError $ ddlExec db "create table t_natural (n integer primary key)" +> mapM_ (insertNatural db) [1..10] +> printPropagateError $ +> ddlExec db "create table t_blob (b blob)" +> printPropagateError $ +> ddlExec db "insert into t_blob values ('blobtest')" + +> insertNatural db n = do +> ddlExec db $ "insert into t_natural values (" ++ (show n) ++ ")" + + + +> destroyFixture db = do +> printPropagateError $ ddlExec db "drop table tdual" +> printPropagateError $ ddlExec db "drop table t_natural" +> printPropagateError $ ddlExec db "drop table t_blob" + + +> testCreateDual db = do +> ignoreError ( do +> ddlExec db "create table tdual (dummy integer primary key)" +> assertFailure "SqliteException not thrown when table already exists" +> ) +> printPropagateError $ ddlExec db "insert into tdual values (1)" + + + + +> testSelectInts db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select n from t_natural where n < 3 order by n;" +> rc <- stmtFetch db stmt +> n <- colValInt stmt 1 +> assertEqual "testSelectInts: 1" 1 n +> rc <- stmtFetch db stmt +> n <- colValInt stmt 1 +> assertEqual "testSelectInts: 2" 2 n +> rc <- stmtFetch db stmt +> stmtFinalise db stmt +> assertEqual "testSelectInts: done" sqliteDONE rc + + +> testSelectInt64 db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select 20041225235959" +> --stmtPrepare db "select -1 union select 1 union select 2*1000*1000*1000 order by 1" +> rc <- stmtFetch db stmt +> n <- colValInt64 stmt 1 +> assertEqual "testSelectInt64: 20041225235959" 20041225235959 n +> rc <- stmtFetch db stmt +> stmtFinalise db stmt +> assertEqual "testSelectInt64: done" sqliteDONE rc + + +> testSelectDouble db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select 1.2" +> rc <- stmtFetch db stmt +> n <- colValDouble stmt 1 +> assertEqual "testSelectDouble: 1.2" 1.2 n +> rc <- stmtFetch db stmt +> stmtFinalise db stmt +> assertEqual "testSelectDouble: done" sqliteDONE rc + + +> testSelectStringNull db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select null" +> rc <- stmtFetch db stmt +> n <- colValString stmt 1 +> assertEqual "testSelectString: Nothing" Nothing n +> rc <- stmtFetch db stmt +> stmtFinalise db stmt +> assertEqual "testSelectString: done" sqliteDONE rc + + +> testSelectStringEmpty db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select ''" +> rc <- stmtFetch db stmt +> -- what is rc after row fetch? sqliteOK or sqliteROW? +> assertEqual "testSelectString: row 1" sqliteROW rc +> n <- colValString stmt 1 +> assertEqual "testSelectString: ''" (Just "") n +> rc <- stmtFetch db stmt +> stmtFinalise db stmt +> assertEqual "testSelectString: done" sqliteDONE rc + + +> testUnion db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select 'h1' from tdual union select 'h2' from tdual union select 'h3' from tdual" +> rc <- stmtFetch db stmt +> Just s <- colValString stmt 1 +> assertEqual "testUnion: h1" "h1" s +> rc <- stmtFetch db stmt +> Just s <- colValString stmt 1 +> assertEqual "testUnion: h2" "h2" s +> rc <- stmtFetch db stmt +> Just s <- colValString stmt 1 +> assertEqual "testUnion: h3" "h3" s +> rc <- stmtFetch db stmt +> stmtFinalise db stmt +> assertEqual "testUnion: done" sqliteDONE rc + + +> testSelectNoRows db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select 'h1' from tdual where dummy = '2'" +> rc <- stmtFetch db stmt +> stmtFinalise db stmt +> assertEqual "testSelectNoRows: done" sqliteDONE rc + + +> manyRows :: String +> manyRows = +> "select 1 from" +> ++ " ( select 1 from tdual union select 0 from tdual)" +> ++ ", ( select 2 from tdual union select 0 from tdual)" +> ++ ", ( select 3 from tdual union select 0 from tdual)" +> ++ ", ( select 4 from tdual union select 0 from tdual)" +> ++ ", ( select 5 from tdual union select 0 from tdual)" +> ++ ", ( select 6 from tdual union select 0 from tdual)" +> ++ ", ( select 7 from tdual union select 0 from tdual)" +> ++ ", ( select 8 from tdual union select 0 from tdual)" +> ++ ", ( select 9 from tdual union select 0 from tdual)" +> ++ ", ( select 10 from tdual union select 0 from tdual)" + + +> countRows :: DBHandle -> StmtHandle -> Int -> IO Int +> countRows db stmt n = do +> rc <- printPropagateError $ stmtFetch db stmt +> _ <- colValInt stmt 1 +> if rc == sqliteDONE +> then return n +> else countRows db stmt (n+1) + +> testSelectManyRows db = do +> stmt <- printPropagateError $ stmtPrepare db manyRows +> n <- countRows db stmt 0 +> stmtFinalise db stmt +> assertEqual "testSelectManyRows: done" 1024 n + +> testBindString db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select ? from tdual" +> bindString db stmt 1 "h1" +> rc <- stmtFetch db stmt +> Just n <- colValString stmt 1 +> assertEqual "testBindString: h1" "h1" n +> rc <- stmtFetch db stmt +> stmtFinalise db stmt + +> testBindDouble db = do +> stmt <- printPropagateError $ +> stmtPrepare db "select ? from tdual where ? = ?" +> bindDouble db stmt 1 2.3 +> bindInt db stmt 2 2001 +> bindInt64 db stmt 3 2001 +> rc <- stmtFetch db stmt +> n <- colValDouble stmt 1 +> assertEqual "testBindDouble: 2.3" 2.3 n +> rc <- stmtFetch db stmt +> stmtFinalise db stmt + + +This test reveals that library misuse (error number 21) +is reported by sqlite_errcode as error code zero. + +> testFetchAfterFinalise db = do +> stmt <- printPropagateError $ stmtPrepare db manyRows +> stmtFinalise db stmt +> rc <- sqliteStep stmt +> assertEqual "testFetchAfterFinalise: rc" 21 rc +> ex@(SqliteException e m) <- getError db +> -- Is this a bug in Sqlite?) +> assertEqual "testFetchAfterFinalise: errcode" 0 e +> assertEqual "testFetchAfterFinalise: errmsg" "not an error" m + + +This test confirms that a constraint error (19) +is correctly reported by sqlite_errcode. + +> testConstraintError db = do +> withUTF8String "insert into t_natural values (1)" $ \cstr -> do +> rc <- sqliteExec db cstr nullFunPtr nullPtr nullPtr +> assertEqual "testConstraintError: rc" 19 rc +> ex@(SqliteException e m) <- getError db +> assertEqual "testConstraintError: errcode" 19 e +> assertEqual "testConstraintError: errmsg" "PRIMARY KEY must be unique" m + + +> testSelectUTF8Text db = do +> -- GREEK SMALL LETTER PHI +> -- unicode code-point 966 +> -- UTF8: CF86 (207,134) +> -- UTF16: 03C6 +> let expect = ['\966'] +> stmt <- printPropagateError $ +> stmtPrepare db "select ?" +> bindString db stmt 1 expect +> rc <- stmtFetch db stmt +> Just n <- colValString stmt 1 +> assertEqual "testSelectUTF8Text" expect n +> stmtFinalise db stmt
+ Database/Stub/Enumerator.lhs view
@@ -0,0 +1,269 @@+ +| +Module : Database.Stub.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Stub implementation of Database.Enumerator. +Useful for people who can't or won't install a DBMS, +so that they can try out the Enumerator interface. + +Currently last last row of any fetch will have a null in its Int columns +(this makes it easier to test handling of nulls and DBUnexpectedNull). +See fetchIntVal. + + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-undecidable-instances #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Stub.Enumerator +> -- Only the type constructor of Session is exported +> -- (so the end user could write type signatures). +> ( Session, ConnParm(..), connect, sql, prefetch +> , QueryResourceUsage(..) +> ) +> where + + +> import Database.InternalEnumerator +> import Foreign +> import Foreign.C +> import Foreign.C.Types +> import Control.Monad +> import Control.Exception (catchDyn, throwDyn, throwIO) +> import System.Time +> import Data.IORef +> import Data.Dynamic + + + +> data ConnParm = ConnParm{ user, pswd, dbname :: String } + + +> data Session = Session +> data StmtHandle = StmtHandle +> data QueryString = QueryString String +> data QueryStringTuned = QueryStringTuned QueryResourceUsage String + + data PreparedStatement = PreparedStatement + { stmtSession :: Session, stmtHandle :: StmtHandle } + +> data Query = Query +> { querySess :: Session +> , queryStmt :: StmtHandle +> , queryCounter :: IORef (IORef Int) +> } + +> data DBColumnType = +> DBTypeInt +> | DBTypeString +> | DBTypeDouble +> | DBTypeDatetime + +> type BufferSize = Int + +|At present the only resource tuning we support is the number of rows +prefetched by the FFI library. +We use a record to (hopefully) make it easy to add other +tuning parameters later. + +> data QueryResourceUsage = QueryResourceUsage { prefetchRowCount :: Int } + +> defaultResourceUsage :: QueryResourceUsage +> defaultResourceUsage = QueryResourceUsage 100 + + +-------------------------------------------------------------------- +-- Sessions +-------------------------------------------------------------------- + +> connect :: ConnParm -> ConnectA Session +> connect connparm = ConnectA (return Session) + +> instance ISession Session where +> disconnect sess = return () +> beginTransaction sess isol = return () +> commit sess = return () +> rollback sess = return () + +-------------------------------------------------------------------- +-- Statements +-------------------------------------------------------------------- + +-- Simple statements: just a string + +> sql :: String -> QueryString +> sql str = QueryString str + +> instance Command QueryString Session where +> executeCommand s q = return 0 + +> instance Statement QueryString Session Query where +> makeQuery sess stmt = do +> -- Leave one counter in to ensure the fetch terminates +> counter <- newIORef numberOfRowsToPretendToFetch +> refc <- newIORef counter +> return (Query sess StmtHandle refc) + +-- Statements with resource usage + +> prefetch :: Int -> String -> QueryStringTuned +> prefetch count str = QueryStringTuned (QueryResourceUsage count) str + +> instance Command QueryStringTuned Session where +> executeCommand s (QueryStringTuned _ str) = executeCommand s (QueryString str) + +> instance Statement QueryStringTuned Session Query where +> -- Currently just ignore the tuning parameter. This is the stub +> -- anyway. We only wish to test different types of statements +> makeQuery s (QueryStringTuned _ str) = makeQuery s (QueryString str) + + +-------------------------------------------------------------------- +-- Queries +-------------------------------------------------------------------- + +See makeQuery below for use of this: + +> numberOfRowsToPretendToFetch :: Int +> numberOfRowsToPretendToFetch = 3 + +See fetchIntVal below for use of this: +Note that rows are counted down from numberOfRowsToPretendToFetch, +so this will throw on the last row. + +> throwNullIntOnRow :: Int +> throwNullIntOnRow = 1 + + +> instance IQuery Query Session ColumnBuffer +> where +> +> fetchOneRow q = do +> -- We'll pretend that we're going to fetch a finite number of rows. +> refCounter <- readIORef (queryCounter q) +> counter <- readIORef refCounter +> if counter > 0 +> then (modifyIORef refCounter pred >> return True) +> else return False +> +> +> currentRowNum q = do +> refCounter <- readIORef (queryCounter q) +> counter <- readIORef refCounter +> return counter +> +> freeBuffer q buffer = return () +> destroyQuery q = return () + + +-------------------------------------------------------------------- +-- result-set data buffers implementation +-------------------------------------------------------------------- + +> data ColumnBuffer = ColumnBuffer +> { colPos :: Int +> } + +> buffer_pos q buffer = +> do +> let col = colPos buffer +> row <- currentRowNum q +> return (row,col) + +An auxiliary function: buffer allocation + +> allocBuffer q bufsize buftype colpos = do +> return $ ColumnBuffer +> { colPos = colpos +> } + +> bufferToString :: ColumnBuffer -> IO (Maybe String) +> bufferToString buffer = return $ Just "boo" + +> bufferToDatetime :: ColumnBuffer -> IO (Maybe CalendarTime) +> bufferToDatetime colbuf = do +> return $ Just $ CalendarTime +> { ctYear = 1971 +> , ctMonth = toEnum 6 +> , ctDay = 1 +> , ctHour = 12 +> , ctMin = 1 +> , ctSec = 1 +> , ctPicosec = 0 +> , ctWDay = Sunday +> , ctYDay = -1 +> , ctTZName = "UTC" +> , ctTZ = 0 +> , ctIsDST = False +> } + +> bufferToInt :: ColumnBuffer -> IO (Maybe Int) +> bufferToInt buffer = return $ Just 1 + +> bufferToDouble :: ColumnBuffer -> IO (Maybe Double) +> bufferToDouble buffer = return $ Just 1.1 + +> {- +> instance DBBind (Maybe a) SessionM PreparedStatement +> => DBBind a SessionM PreparedStatement where +> bindPos v q p = return () + +> instance DBBind (Maybe String) SessionM PreparedStatement where +> bindPos v q p = return () + +> instance DBBind (Maybe Int) SessionM PreparedStatement where +> bindPos v q p = return () + +> instance DBBind (Maybe Double) SessionM PreparedStatement where +> bindPos v q p = return () + +> instance DBBind (Maybe CalendarTime) SessionM PreparedStatement where +> bindPos v q p = return () + +> instance (Show a, Read a) => DBBind (Maybe a) SessionM PreparedStatement where +> bindPos v q p = return () +> -} + +> instance DBType (Maybe a) Query ColumnBuffer +> => DBType a Query ColumnBuffer where +> allocBufferFor _ = allocBufferFor (undefined::Maybe a) +> fetchCol q buffer = throwIfDBNull (buffer_pos q buffer) $ fetchCol q buffer + +> instance DBType (Maybe String) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q 4000 DBTypeString n +> fetchCol q buffer = bufferToString buffer + +> instance DBType (Maybe Int) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q 4 DBTypeInt n +> fetchCol query buffer = do +> refCounter <- readIORef (queryCounter query) +> counter <- readIORef refCounter +> -- last row returns null rather than 1 +> if counter == throwNullIntOnRow +> then return Nothing +> else bufferToInt buffer + +> instance DBType (Maybe Double) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q 8 DBTypeDouble n +> fetchCol q buffer = bufferToDouble buffer + +> instance DBType (Maybe CalendarTime) Query ColumnBuffer where +> allocBufferFor _ q n = allocBuffer q 8 DBTypeDatetime n +> fetchCol q buffer = bufferToDatetime buffer + +A polymorphic instance which assumes that the value is in a String column, +and uses Read to convert the String to a Haskell data value. + +> instance (Show a, Read a) => DBType (Maybe a) Query ColumnBuffer where +> allocBufferFor _ = allocBufferFor (undefined::String) +> fetchCol q buffer = do +> v <- bufferToString buffer +> case v of +> Just s -> if s == "" then return Nothing else return (Just (read s)) +> Nothing -> return Nothing
+ Database/Stub/Test/Enumerator.lhs view
@@ -0,0 +1,180 @@+ +| +Module : Database.Stub.Test.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Simple test harness for Stub. +Stub can't share the tests for \"real\" backends because it +returns a somewhat contrived result set. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Stub.Test.Enumerator (runTest) where + +> import Database.Enumerator +> import Database.Stub.Enumerator +> -- import Database.Test.Performance as Perf +> import System.Time -- CalendarTime +> import Test.MiniUnit +> import Data.Int +> import Control.Monad.Trans (liftIO) + + + + +> runTest :: a -> [String] -> IO () +> runTest _ _ = +> withSession (connect (ConnParm "" "" "")) +> (runTestTT "Stub tests" (map runOneTest testList) >> return ()) + +> runOneTest t = catchDB (t ()) reportRethrow + +> testList :: [() -> DBM mark Session ()] +> testList = +> [ selectString, selectIterIO, selectFloatInt +> , selectStringNullInt, selectDatetime +> , selectCursor, selectExhaustCursor +> ] + +> selectTest iter expect = catchDB ( do +> actual <- doQuery (sql "") iter [] +> liftIO $ assertEqual "" expect actual +> ) (\e -> return () ) +> selectTest' iter expect = catchDB ( do +> actual <- doQuery (prefetch 10 "") iter [] +> liftIO $ assertEqual "" expect actual +> ) (\e -> return () ) + +> selectString () = selectTest iter expect +> where +> -- To illustrate that the full signature is not necessary as long +> -- as some type information (e.g., (c1::String)) is provided -- +> -- or enough context for the compiler to figure that out. +> -- iter :: (Monad m) => String -> IterAct m [String] +> -- iter :: String -> IterAct (DBM mark Session) [String] +> iter (c1::String) acc = result $ c1:acc +> expect = [ "boo", "boo", "boo" ] + + +The following test illustrates doing IO in the iteratee itself. + +> -- monomorphism restriction strikes... +> selectIterIO () = selectTest iter ([]::[String]) +> where +> -- Here, it's better to avoid the signature and specify +> -- types of the arguments specifically so we do not have to +> -- figure out which exactly Monad we're operating in. +> -- We let the compiler figure out the right monad from +> -- the context (that is, from the Session) +> --iter :: String -> IterAct (ReaderT Query SessionQuery) () +> iter (c1::String) seed = do +> ct <- liftIO $ getClockTime +> liftIO $ putStr "<look: IO>" +> result seed + + +> selectFloatInt () = selectTest' iter expect +> where +> iter :: (Monad m) => Double -> Int -> IterAct m [(Double, Int)] +> iter c1 c2 acc = result $ (c1, c2):acc +> expect = [ (1.1, 1), (1.1, 1), (1.1, 1) ] + + + +> selectStringNullInt () = selectTest' iter expect +> where +> iter :: (Monad m) => +> String -> Maybe Int -> IterAct m [(String, Int)] +> iter c1 c2 acc = result $ (c1, ifNull c2 (-(1))):acc +> expect = [ ("boo", 1), ("boo", -1), ("boo", 1) ] + + +> defDate = makeCalTime 19710701120101 + +> selectDatetime () = selectTest iter expect +> where +> iter :: (Monad m) => CalendarTime -> IterAct m [CalendarTime] +> iter c1 acc = result $ c1:acc +> expect = [ defDate, defDate, defDate ] + + + +> selectCursor () = do +> let +> iter :: (Monad m) => Maybe Int -> IterAct m [Int] +> iter i acc = result $ (ifNull i 2):acc +> withCursor (sql "") iter [] $ \c -> do +> r <- cursorCurrent c +> liftIO $ assertEqual "selectCursor" [1] r +> doneBool <- cursorIsEOF c +> liftIO $ assertEqual "selectCursor" False doneBool +> -- +> cursorNext c +> r <- cursorCurrent c +> liftIO $ assertEqual "selectCursor" [2, 1] r +> doneBool <- cursorIsEOF c +> liftIO $ assertEqual "selectCursor" False doneBool +> -- +> cursorNext c +> r <- cursorCurrent c +> liftIO $ assertEqual "selectCursor" [1, 2, 1] r +> doneBool <- cursorIsEOF c +> liftIO $ assertEqual "selectCursor" False doneBool +> -- +> cursorNext c +> r <- cursorCurrent c +> liftIO $ assertEqual "selectCursor" [1, 2, 1] r +> doneBool <- cursorIsEOF c +> liftIO $ assertEqual "selectCursor" True doneBool +> -- +> return () + + + +> selectExhaustCursor () = catchDB (do +> let +> -- Again, here we demonstrate the use of a local argument +> -- type annotation rather than the complete signature. +> -- Let the compiler figure out the monad and the seed type. +> --iter :: (Maybe m) => Maybe Int -> IterAct m [Int] +> iter (i::Maybe Int) acc = result $ (ifNull i (-(1))):acc +> withCursor (sql "") iter [] $ \c -> do +> cursorNext c +> cursorNext c +> cursorNext c +> cursorNext c +> liftIO $ assertFailure "selectExhaustCursor" +> return () +> ) (\e -> return () ) + + +> makeCalTime :: Int64 -> CalendarTime +> makeCalTime i = +> let +> year = (i `quot` 10000000000) +> month = ((abs i) `rem` 10000000000) `quot` 100000000 +> day = ((abs i) `rem` 100000000) `quot` 1000000 +> hour = ((abs i) `rem` 1000000) `quot` 10000 +> minute = ((abs i) `rem` 10000) `quot` 100 +> second = ((abs i) `rem` 100) +> in CalendarTime +> { ctYear = fromIntegral year +> , ctMonth = toEnum (fromIntegral month - 1) +> , ctDay = fromIntegral day +> , ctHour = fromIntegral hour +> , ctMin = fromIntegral minute +> , ctSec = fromIntegral second +> , ctPicosec = 0 +> , ctWDay = Sunday +> , ctYDay = -1 +> , ctTZName = "UTC" +> , ctTZ = 0 +> , ctIsDST = False +> } +
+ Database/Test/Enumerator.lhs view
@@ -0,0 +1,451 @@+ +| +Module : Database.Test.Enumerator +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Simple test harness. Demonstrates possible usage. + +Tests in this module are organised in groups of three/four functions: + sqlXXX + iterXXX + expectXXX + actionXXX + +These have to be tied together by a function which uses backend-specific +functions and types. See the various backend-specific test modules for examples. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Test.Enumerator where + +> import Database.Enumerator +> import Database.Util +> import Data.Time +> import System.Time +> import Data.Int +> import Control.Exception.MonadIO +> import Control.Monad.Trans (liftIO) +> --import Test.HUnit +> import Test.MiniUnit + + +> testTable = "takusen_test" + +> sqlDropDual = "drop table tdual" +> sqlCreateDual = "create table tdual (dummy varchar(1) primary key)" +> sqlInsertDual = "insert into tdual values ('X')" +> sqlDropTest = "drop table " ++ testTable +> sqlCreateTest = "create table " ++ testTable ++ " (id integer, v varchar(1000))" + +> sqlInsertTest1 = "insert into " ++ testTable ++ " (id, v) values (1, '2')" +> sqlInsertTest2 = "insert into " ++ testTable ++ " (id, v) values (2, '2')" +> sqlInsertTest3 = "insert into " ++ testTable ++ " (id, v) values (3, '3')" +> sqlInsertTest4 = "insert into " ++ testTable ++ " (id, v) values (4, '4')" + + +> reportError sql (DBFatal (ssc, sssc) e m) = do +> putStrLn ("FATAL: " ++ ssc ++ sssc ++ " - " ++ m) +> putStrLn (" " ++ sql) +> reportError sql (DBError (ssc, sssc) e m) = do +> putStrLn ("ERROR: " ++ ssc ++ sssc ++ " - " ++ m) +> putStrLn (" " ++ sql) +> reportError sql (DBUnexpectedNull r c) = +> putStrLn $ "Unexpected null in row " ++ (show r) ++ ", column " ++ (show c) ++ "." +> reportError sql (DBNoData) = putStrLn "Fetch: no more data." + +----------------------------------------------------------- + +> class DBLiteralValue a where +> literalDate :: a -> Int64 -> String +> literalInt :: a -> Int -> String +> literalInt64 :: a -> Int64 -> String +> literalFloat :: a -> Float -> String +> literalDouble :: a -> Double -> String +> -- default methods +> literalInt _ i = show i +> literalInt64 _ i = show i +> literalFloat _ i = show i +> literalDouble _ i = show i + + +> data SqliteFunctions = SqliteFunctions +> data OracleFunctions = OracleFunctions +> data PGSqlFunctions = PGSqlFunctions +> data ODBCFunctions = ODBCFunctions + +> instance DBLiteralValue SqliteFunctions where +> literalDate _ i = dateSqlite i + +> instance DBLiteralValue OracleFunctions where +> literalDate _ i = dateOracle i + +> instance DBLiteralValue PGSqlFunctions where +> literalDate _ i = datePG i +> literalInt _ i = show i ++ "::int4" +> literalInt64 _ i = show i ++ "::int8" +> literalFloat _ i = show i ++ "::float4" +> literalDouble _ i = show i ++ "::float8" + +> instance DBLiteralValue ODBCFunctions where +> literalDate _ i = dateISO i + + + +> dateSqlite :: Int64 -> String +> dateSqlite i = if i == 0 then "99999999999999" else show i + +> dateOracle :: Int64 -> String +> dateOracle i +> | i == 0 = "to_date(null)" +> | i > 0 = "to_date('" ++ (zeroPad 14 i) ++ "', 'yyyymmddhh24miss')" +> | i < 0 = "to_date('" ++ (zeroPad 14 i) ++ "', 'syyyymmddhh24miss')" + +> dateISO :: Int64 -> String +> dateISO i = +> let +> (year, month, day, hour, minute, second) = int64ToDateParts i +> zp = zeroPad +> in +> if i == 0 then "null" +> else zp 4 year ++ "-" ++ zp 2 month ++ "-" ++ zp 2 day +> ++ "T" ++ zp 2 hour ++ ":" ++ zp 2 minute ++ ":" ++ zp 2 second + + +For postgres: +0000-01-01 AD -> 0001-01-01 BC +0000-12-31 AD -> 0001-12-31 BC +0001-01-01 AD -> 0001-01-01 AD + +Using Doubles as storage (not sure about this?) +4714-11-24 BC -> mindate +5874897-12-31 AD -> maxdate +Using 8-bytes ints: +4713 BC -> 294276 AD + +Postgres only allows specification of -ve years by use of the AD/BC suffix. +Sadly, this differs from the astronomical year number like so: +astro: ...3,2,1,0,-1,-2,-3,... +ad/bc: ...3AD,2AD,1AD,1BC,2BC,3BC,... + +i.e. 0 astro = 1BC, -1 astro = 2BC, etc. + +ISO8601 uses astronomical years, so we ought to be able to write +-1000-12-25 (instead of 1001-01-01 BC), but Postgres won't parse this. + +So in datePG we want: +int64 0000-01-01 -> 0001-01-01 AD +int64 0001-01-01 -> 0001-01-01 AD +int64 -0001-01-01 -> 0000-01-01 AD +int64 -0002-01-01 -> 0003-01-01 BC +int64 -4712-01-01 -> 4713-01-01 BC + +> datePG :: Int64 -> String +> datePG i = +> let +> (year1, month, day, hour, minute, second) = int64ToDateParts i +> year = case () of +> _ | year1 == 0 -> 1 +> | year1 < 0 -> abs (year1 - 1) +> | otherwise -> year1 +> suffix = if year1 < 1 then " BC'" else " AD'" +> zp = zeroPad +> in +> if i == 0 then "null::timestamp" +> --else "timestamp with time zone '" ++ zp 4 year ++ "-" ++ zp 2 month ++ "-" ++ zp 2 day +> else "timestamp '" ++ zp 4 year ++ "-" ++ zp 2 month ++ "-" ++ zp 2 day +> ++ " " ++ zp 2 hour ++ ":" ++ zp 2 minute ++ ":" ++ zp 2 second ++ suffix + + + + +> execDDL_ s = catchDB (execDDL s) (\e -> liftIO (reportError s e) >> throwDB e) +> execDML_ s = execDDL_ s + +Use execDrop when the DDL is likely to raise an error. +Note that PostgreSQL + ODBC seems to require you commit or rollback the DDL; +if you don't then the next statement will fail with a 25P02 +("in failed SQL transaction") +I guess that's a result of PostgreSQL's transactional DDL feature. + +> execDrop s = catchDB (withTransaction Serializable (execDDL s)) (\e -> return ()) + +> makeFixture doDrop doDDL = flip catchDB (reportRethrowMsg "makeFixture: ") $ do +> doDrop sqlDropDual +> doDrop sqlDropTest +> doDDL sqlCreateDual +> beginTransaction ReadCommitted +> doDDL sqlInsertDual +> commit +> doDDL sqlCreateTest +> withTransaction Serialisable $ do +> doDDL sqlInsertTest1 +> doDDL sqlInsertTest2 +> doDDL sqlInsertTest3 + +> destroyFixture execDDL_ = flip catchDB reportRethrow $ do +> execDDL_ sqlDropDual +> execDDL_ sqlDropTest + +> selectTest query iter expect = do +> actual <- doQuery query iter [] +> assertEqual query expect actual + + + +----------------------------------------------------------- + +This is used in a few tests... + +> sqlSingleValue = "select ? from tdual" + +> sqlNoRows = "select dummy from tdual where dummy = 'a' or dummy = '2' " +> iterNoRows (c1::String) acc = result $ c1:acc +> expectNoRows = []::[String] + +> sqlTermEarly = "select 'hello1' from tdual union select 'hello2' from tdual union select 'hello3' from tdual" +> iterTermEarly c1 acc = if c1 == "hello2" +> then return (Left (c1:acc)) +> else result (c1:acc) +> expectTermEarly = ["hello2", "hello1"] + +> sqlFloatsAndInts fns = "select " ++ (literalDouble fns 4841.3403490431) ++ ", " +> ++ (literalInt fns (-22340234)) ++ " from tdual union select 33311.32332, 23789234 from tdual" +> --iterFloatsAndInts :: (Monad m) => Double -> Int -> IterAct m [(Double, Int)] +> iterFloatsAndInts (c1::Double) (c2::Int) acc = result $ (c1, c2):acc +> expectFloatsAndInts :: [(Double, Int)] +> expectFloatsAndInts = [ (33311.32332, 23789234) , (4841.3403490431, -22340234) ] + +> sqlNullString = "select 'hello1', 'hello2', null from tdual" +> iterNullString :: (Monad m) => String -> String -> Maybe String +> -> IterAct m [(String, String, Maybe String)] +> iterNullString c1 c2 c3 acc = result $ (c1, c2, c3):acc +> expectNullString = [ ("hello1", "hello2", Nothing) ] + +> sqlEmptyString = "select 'hello1', 'hello2', '' from tdual /* Oracle always fails this test */" +> iterEmptyString :: (Monad m) => String -> String -> Maybe String +> -> IterAct m [(String, String, Maybe String)] +> iterEmptyString c1 c2 c3 acc = result $ (c1, c2, c3):acc +> expectEmptyString = [ ("hello1", "hello2", Just "") ] + +> sqlUnhandledNull = "select 'hello1', 'hello2', null from tdual" +> iterUnhandledNull :: (Monad m) => String -> String -> UTCTime +> -> IterAct m [(String, String, UTCTime)] +> iterUnhandledNull c1 c2 c3 acc = result $ (c1, c2, c3):acc +> expectUnhandledNull = [] + +> sqlNullDate fns = "select 'hello1', 'hello2', " ++ (literalDate fns 0) ++ " from tdual" +> iterNullDate :: (Monad m) => String -> String -> Maybe UTCTime +> -> IterAct m [(String, String, UTCTime)] +> iterNullDate c1 c2 c3 acc = result $ (c1, c2, ifNull c3 (int64ToUTCTime 10101000000)):acc +> expectNullDate = [ ("hello1", "hello2", (int64ToUTCTime 10101000000)) ] + +> sqlDate fns = "select " ++ (literalDate fns 20041224235959) ++ " from tdual" +> iterDate :: (Monad m) => UTCTime -> IterAct m [UTCTime] +> iterDate c1 acc = result $ c1:acc +> expectDate = [ (int64ToUTCTime 20041224235959) ] + +> iterCalDate :: (Monad m) => CalendarTime -> IterAct m [CalendarTime] +> iterCalDate c1 acc = result $ c1:acc +> expectCalDate = [ (int64ToCalTime 20041224235959) ] + + +These are the Oracle date boundary cases. + +> sqlBoundaryDates fns = +> "select " ++ (literalDate fns 99991231000000) ++ " from tdual" +> ++ " union select " ++ (literalDate fns 10101000000) ++ " from tdual" +> ++ " union select " ++ (literalDate fns (-10101000000)) ++ " from tdual" +> ++ " union select " ++ (literalDate fns (-47120101000000)) ++ " from tdual" +> ++ " order by 1 desc" +> iterBoundaryDates :: (Monad m) => UTCTime -> IterAct m [UTCTime] +> iterBoundaryDates c1 acc = result $ c1:acc +> expectBoundaryDates = +> [ int64ToUTCTime (-47120101000000) +> , int64ToUTCTime (-10101000000) +> , int64ToUTCTime 10101000000 +> , int64ToUTCTime 99991231000000 +> ] + +|Goal: exercise the "happy path" throught cursor code +i.e. open and fetch all rows, close after last row. + +> sqlCursor fns = "select " ++ literalInt fns 1 ++ " from tdual union select " ++ literalInt fns 2 ++ " from tdual" +> iterCursor :: (Monad m) => Int -> IterAct m [Int] +> iterCursor i acc = result $ i:acc +> actionCursor query = do +> withCursor query iterCursor [] $ \c -> do +> doneBool <- cursorIsEOF c +> assertBool query (not doneBool) +> r <- cursorCurrent c +> assertEqual query [1] r +> -- +> cursorNext c +> doneBool <- cursorIsEOF c +> assertBool query (not doneBool) +> r <- cursorCurrent c +> assertEqual query [2, 1] r +> -- +> -- Now that the result-set is exhausted, cursorIsEOF returns True, +> -- and cursorCurrent returns the same value as the previous call to cursorCurrent. +> cursorNext c +> doneBool <- cursorIsEOF c +> assertBool query doneBool +> r <- cursorCurrent c +> assertEqual query [2, 1] r +> -- +> -- What happens if try to advance again? +> -- We get a DBException: the DBNoData case. +> --cursorNext c +> doneBool <- cursorIsEOF c +> assertBool query doneBool +> r <- cursorCurrent c +> assertEqual query [2, 1] r +> -- +> return () + +|Goal: ensure exception raised when too many rows +fetched from cursor. + +This test will raise an exception, as it tries to +fetch too many rows from the cursor. +The exception handler is coded as if we expect the +exception i.e. it ignores it. +The main action should never finish, so there's +a failure assertion at the bottom, just in case +the exception is not raised. + +> actionExhaustCursor query = catchDB ( +> withCursor query iterCursor [] $ \c -> do +> cursorNext c +> cursorNext c +> cursorNext c +> cursorNext c +> assertFailure "selectExhaustCursor" +> ) (\e -> return () ) + +> sqlBindString = "select ? from tdual union select ? from tdual order by 1" +> iterBindString :: (Monad m) => String -> IterAct m [String] +> iterBindString i acc = result $ i:acc +> expectBindString = ["b1", "a2"] +> actionBindString stmt bindVals = do +> withTransaction Serialisable $ do +> withPreparedStatement stmt $ \pstmt -> do +> withBoundStatement pstmt bindVals $ \bstmt -> do +> actual <- doQuery bstmt iterBindString [] +> assertEqual sqlBindString expectBindString actual + + +Each back-end has it's own idea of parameter placeholder syntax. +We currently support ?-style as a lowest-common-denominator, +and each back-end converts occurences of "?" +to the back-end-specific style where required. +If you use a back-end specific style, you can expect it to be passed +through unmolested. + ? : ODBC, MS Sql Server, Sqlite + :n : Oracle + $n : Postgres + +> sqlBindInt = "select ? from tdual union select ? from tdual order by 1" +> iterBindInt :: (Monad m) => Int -> IterAct m [Int] +> iterBindInt i acc = result $ i:acc +> expectBindInt :: [Int]; expectBindInt = [2, 1] +> actionBindInt stmt bindVals = do +> withTransaction Serialisable $ do +> withPreparedStatement stmt $ \pstmt -> do +> withBoundStatement pstmt bindVals $ \bstmt -> do +> actual <- doQuery bstmt iterBindInt [] +> assertEqual sqlBindInt expectBindInt actual + +> sqlBindIntDoubleString = "select ?,?,? from tdual union select ?,?,? from tdual order by 1" +> iterBindIntDoubleString :: (Monad m) => Int -> Double -> String -> IterAct m [(Int, Double, String)] +> iterBindIntDoubleString i d s acc = result $ (i, d, s):acc +> expectBindIntDoubleString :: [(Int, Double, String)] +> expectBindIntDoubleString = [(3, 4.4, "row 2"), (1, 2.2, "row 1")] +> actionBindIntDoubleString stmt = do +> withTransaction Serialisable $ do +> actual <- doQuery stmt iterBindIntDoubleString [] +> assertEqual sqlBindIntDoubleString expectBindIntDoubleString actual + +> sqlBindDate = sqlSingleValue +> iterBindDate :: (Monad m) => UTCTime -> IterAct m [UTCTime] +> iterBindDate c1 acc = result $ c1:acc +> expectBindDate = [ (int64ToUTCTime 20041224235959) ] +> actionBindDate stmt = do +> withTransaction Serialisable $ do +> actual <- doQuery stmt iterBindDate [] +> assertEqual sqlBindDate expectBindDate actual + +> sqlBindBoundaryDates = +> "select ? from tdual" +> ++ " union select ? from tdual" +> ++ " union select ? from tdual" +> ++ " union select ? from tdual" +> ++ " order by 1 desc" +> actionBindBoundaryDates stmt = do +> withTransaction Serialisable $ do +> actual <- doQuery stmt iterBindDate [] +> assertEqual sqlBindBoundaryDates expectBoundaryDates actual + + +> sqlBoundStmtDML = "insert into " ++ testTable ++ " (id, v) values (?, ?)" +> actionBoundStmtDML stmt = do +> beginTransaction Serialisable +> withPreparedStatement stmt $ \pstmt -> do +> withBoundStatement pstmt [bindP (100::Int), bindP "100"] $ \bstmt -> do +> count <- execDML bstmt +> rollback +> assertEqual sqlBoundStmtDML 1 count + + + +With 'MyTree' we test the ability to send and receive arbtrary Show-able +values as Strings i.e. we create our own datatype for the test. + +> data MyTree a = Leaf a | Branch [MyTree a] deriving (Eq, Show, Read) + +> sqlPolymorphicFetch = sqlSingleValue +> iterPolymorphicFetch :: (Monad m) => MyTree String -> IterAct m (MyTree String) +> iterPolymorphicFetch v _ = result' v +> expectPolymorphicFetch = Branch [Leaf "a", Leaf "b", Branch [Leaf "c", Leaf "d"], Leaf "e"] +> actionPolymorphicFetch stmt = do +> actual <- doQuery stmt iterPolymorphicFetch (Leaf "") +> assertEqual sqlPolymorphicFetch expectPolymorphicFetch actual + +> sqlPolymorphicFetchNull = "select '' from tdual" +> iterPolymorphicFetchNull :: (Monad m) => Maybe (MyTree String) -> IterAct m (Maybe (MyTree String)) +> iterPolymorphicFetchNull v _ = result' v +> expectPolymorphicFetchNull :: Maybe (MyTree String) +> expectPolymorphicFetchNull = Nothing +> actionPolymorphicFetchNull stmt = do +> actual <- doQuery stmt iterPolymorphicFetchNull Nothing +> assertEqual sqlPolymorphicFetchNull Nothing actual + +> sqlRebind = sqlSingleValue +> iterRebind (i::Int) acc = result $ i:acc +> expectRebind1 :: [Int]; expectRebind1 = [1] +> expectRebind2 :: [Int]; expectRebind2 = [2] +> actionRebind stmt bindVal1 bindVal2 = do +> withPreparedStatement stmt $ \pstmt -> do +> withBoundStatement pstmt bindVal1 $ \bstmt -> do +> actual <- doQuery bstmt iterRebind [] +> assertEqual sqlRebind expectRebind1 actual +> withBoundStatement pstmt bindVal2 $ \bstmt -> do +> actual <- doQuery bstmt iterRebind [] +> assertEqual sqlRebind expectRebind2 actual + +> sqlExceptionRollback = "select count(*) from " ++ testTable +> iterExceptionRollback (i::Int) acc = result $ i:acc +> actionExceptionRollback insertStmt selectStmt = do +> gcatch ( +> withTransaction Serialisable $ do +> execDML insertStmt +> assertFailure "selectExhaustCursor" +> ) (\e -> return () ) +> count <- doQuery selectStmt iterExceptionRollback [] +> assertEqual sqlExceptionRollback [3] count
+ Database/Test/MultiConnect.lhs view
@@ -0,0 +1,36 @@+ +| +Module : Database.Test.MultiConnect +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Tests Database.Enumerator code in the context of multiple +database connections to different DBMS products. +We should add tests to shift data between databases, too. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Test.MultiConnect (runTest) where + +> import qualified Database.Sqlite.Enumerator as Sqlite +> import qualified Database.PostgreSQL.Enumerator as PG +> import Database.Sqlite.Test.Enumerator as SqlTest +> import Database.PostgreSQL.Test.Enumerator as PGTest +> import Database.Test.Performance as Perf +> import Database.Enumerator +> import System.Environment (getArgs) + + +> runTest :: Perf.ShouldRunTests -> [String] -> IO () +> runTest runPerf args = catchDB ( do +> let [ user, pswd, dbname ] = args +> withSession (PG.connect user pswd dbname) $ \sessPG -> do +> withSession (Sqlite.connect user pswd dbname) $ \sessSql -> do +> SqlTest.runTest runPerf args +> PGTest.runTest runPerf args +> ) basicDBExceptionReporter
+ Database/Test/Performance.lhs view
@@ -0,0 +1,100 @@+ +| +Module : Database.Test.Performance +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Performance tests. Currently just tests large result sets. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} + +> module Database.Test.Performance where + +> import Database.Enumerator +> import Database.Util +> import System.Environment (getArgs) +> import Control.Monad +> import System.Time +> import Test.MiniUnit +> import Control.Monad.Reader + +> data ShouldRunTests = RunTests | Don'tRunTests deriving (Show, Eq) + +> timedCursor stmt limit rows = do +> withCursor stmt (rowCounter rows) 0 $ \c -> do +> ct1 <- liftIO getClockTime +> replicateM_ rows (cursorNext c) +> ct2 <- liftIO getClockTime +> let diffCt = diffClockTimes ct2 ct1 +> let limitDiff = TimeDiff 0 0 0 0 0 limit 0 +> print_ $ "timedCursor: " ++ timeDiffToString diffCt +> assertBool ("timedCursor: time " ++ (timeDiffToString diffCt) ++ " (limit " ++ (timeDiffToString limitDiff) ++ ")") +> (diffCt < limitDiff) + + +> timedSelect stmt limit rows = do +> ct1 <- liftIO getClockTime +> r <- doQuery stmt (rowCounter rows) 0 +> ct2 <- liftIO getClockTime +> let diffCt = diffClockTimes ct2 ct1 +> -- assume it must complete within limit seconds +> let limitDiff = TimeDiff 0 0 0 0 0 limit 0 +> print_ $ "timedSelect: " ++ timeDiffToString diffCt +> assertBool ("timedSelect: time " ++ (timeDiffToString diffCt) ++ " (limit " ++ (timeDiffToString limitDiff) ++ ")") +> (diffCt < limitDiff) +> assertEqual ("timedSelect: rows " ++ (show r)) rows r + + +|This counter takes the maximum number of rows to fetch as its first argument, +so don't forget to curry it when using it as an iteratee function. +We also try to ensure that it is strict in the counter; +we don't want thousands or millions of unevaluated '+' thunks sitting +on the stack. + +> rowCounter :: (Monad m) => Int -> Int -> IterAct m Int +> rowCounter n _ i = result' (i+1) +> --if i >= n then return (Left $! i) else return (Right $! (1 + i)) +> --if i >= n then return (Left i) else return (Right (1 + i)) + + +2 ^ 16 = 65536 +2 ^ 20 = 1048576 + +Cartesian product. Each instance of the subquery multiplies +the total number of rows by 2, so the number of rows +is 2 ^ (count of subquery instances). +You start to notice the pause around 2^13, +and 2^16 blows out the standard 1M stack +if you use the lazy version of result. Bummer. + +> sqlRows2Power17 :: String +> sqlRows2Power17 = +> "select 1 from" +> ++ " ( select 1 from tdual union select 0 from tdual) t1" +> ++ ", ( select 2 from tdual union select 0 from tdual) t2" +> ++ ", ( select 3 from tdual union select 0 from tdual) t3" +> ++ ", ( select 4 from tdual union select 0 from tdual) t4" +> ++ ", ( select 5 from tdual union select 0 from tdual) t5" +> ++ ", ( select 6 from tdual union select 0 from tdual) t6" +> ++ ", ( select 7 from tdual union select 0 from tdual) t7" +> ++ ", ( select 8 from tdual union select 0 from tdual) t8" +> ++ ", ( select 9 from tdual union select 0 from tdual) t9" +> ++ ", ( select 10 from tdual union select 0 from tdual) t10" +> ++ ", ( select 11 from tdual union select 0 from tdual) t11" +> ++ ", ( select 12 from tdual union select 0 from tdual) t12" +> ++ ", ( select 13 from tdual union select 0 from tdual) t13" +> ++ ", ( select 14 from tdual union select 0 from tdual) t14" +> ++ ", ( select 15 from tdual union select 0 from tdual) t15" +> ++ ", ( select 16 from tdual union select 0 from tdual) t16" +> ++ ", ( select 17 from tdual union select 0 from tdual) t17" + +> sqlRows2Power20 :: String +> sqlRows2Power20 = sqlRows2Power17 +> ++ ", ( select 18 from tdual union select 0 from tdual) t18" +> ++ ", ( select 19 from tdual union select 0 from tdual) t19" +> ++ ", ( select 20 from tdual union select 0 from tdual) t20"
+ Database/Test/Util.lhs view
@@ -0,0 +1,130 @@+> {-# LANGUAGE CPP #-} +> {-# OPTIONS -cpp #-} + +> module Database.Test.Util where + +> import Database.Util +> import Test.MiniUnit +> import Data.Int +> import Data.Char + + +> runTest :: a -> [String] -> IO () +> runTest _ _ = do +> counts <- runTestTT "Util module tests" testlist +> return () + +> testlist = +> [ testSubstr +> , testWordsBy +> , testInt64ToDatePartsMinDate +> , testInt64ToDatePartsMaxDate +> , testUtcTimeToInt64MinDate +> , testUtcTimeToInt64MaxDate +> , testCalTimeToInt64MinDate +> , testCalTimeToInt64MaxDate +> , testInt64ToCalTimeMinDate +> , testInt64ToCalTimeMaxDate +> , testPGDatetimeToUTCTimeMinDate +> , testPGDatetimeToUTCTimeMaxDate +> , testPGDatetimeToUTCTimeBCBoundary +> , testPGDatetimeToUTCTimeBCBoundary2 +> , testUTCTimeToPGDatetimeMinDate +> , testUTCTimeToPGDatetimeMaxDate +> ] + +> testSubstr = do +> assertEqual "substr - 1" "a" (substr 1 1 "abc") +> assertEqual "substr - 2" "b" (substr 2 1 "abc") +> assertEqual "substr - 3" "c" (substr 3 1 "abc") +> assertEqual "substr - 4" "bc" (substr 2 2 "abc") +> assertEqual "substr - 5" "ab" (substr 1 2 "abc") +> assertEqual "substr - 6" "abc" (substr 1 4 "abc") +> assertEqual "substr -76" "" (substr 4 4 "abc") + +> testWordsBy = do +> assertEqual "wordsBy - 1" [] (wordsBy isDigit "") +> assertEqual "wordsBy - 2" [] (wordsBy isDigit " --,") +> assertEqual "wordsBy - 2.5" ["5"] (wordsBy isDigit "5") +> assertEqual "wordsBy - 2.75" ["5"] (wordsBy isDigit "5 ") +> assertEqual "wordsBy - 3" ["5"] (wordsBy isDigit "5 --,") +> assertEqual "wordsBy - 4" ["6"] (wordsBy isDigit " --,6") +> assertEqual "wordsBy - 5" ["7"] (wordsBy isDigit " --7, ") +> assertEqual "wordsBy - 6" ["100", "12", "67", "25"] (wordsBy isDigit "100-12,67--, 25") + + +-4712 (4713BC?) is a very common minimum date among DBMS implementations. +Maximum varies, but is often 5874897 AD. + +ghc-6.4.1 needs this, because it only has Show instances for +up to 5-tuples. + +#if __GLASGOW_HASKELL__ <= 604 +> instance (Show a, Show b, Show c, Show d, Show e, Show f) +> => Show (a,b,c,d,e,f) where +> show (a,b,c,d,e,f) = +> "(" ++ show a +> ++ "," ++ show a +> ++ "," ++ show b +> ++ "," ++ show c +> ++ "," ++ show d +> ++ "," ++ show e +> ++ "," ++ show f +> ++ ")" +#endif + +> testInt64ToDatePartsMinDate = do +> let expect :: (Int64,Int64,Int64,Int64,Int64,Int64); expect = (-4712,1,1,0,0,0) +> assertEqual "testInt64ToDatePartsMinDate" expect (int64ToDateParts (-47120101000000)) + +> testInt64ToDatePartsMaxDate = do +> let expect :: (Int64,Int64,Int64,Int64,Int64,Int64); expect = (999999,12,31,23,59,59) +> assertEqual "testInt64ToDatePartsMaxDate" expect (int64ToDateParts (9999991231235959)) + +> testUtcTimeToInt64MinDate = do +> let expect :: Int64; expect = (-47120101000000) +> assertEqual "testUtcTimeToInt64MinDate" expect (utcTimeToInt64 (mkUTCTime (-4712) 1 1 0 0 0)) + +> testUtcTimeToInt64MaxDate = do +> let expect :: Int64; expect = (9999991231235959) +> assertEqual "testUtcTimeToInt64MaxDate" expect (utcTimeToInt64 (mkUTCTime 999999 12 31 23 59 59)) + +> testCalTimeToInt64MinDate = do +> let expect :: Int64; expect = (-47120101000000) +> assertEqual "testCalTimeToInt64MinDate" expect (calTimeToInt64 (mkCalTime (-4712) 1 1 0 0 0)) + +> testCalTimeToInt64MaxDate = do +> let expect :: Int64; expect = (9999991231235959) +> assertEqual "testCalTimeToInt64MaxDate" expect (calTimeToInt64 (mkCalTime 999999 12 31 23 59 59)) + +> testInt64ToCalTimeMinDate = do +> let expect = mkCalTime (-4712) 1 1 0 0 0 +> assertEqual "testCalTimeToInt64MaxDate" expect (int64ToCalTime (-47120101000000)) + +> testInt64ToCalTimeMaxDate = do +> let expect = mkCalTime 999999 12 31 23 59 59 +> assertEqual "testCalTimeToInt64MaxDate" expect (int64ToCalTime 9999991231235959) + +> testPGDatetimeToUTCTimeMinDate = do +> let expect = mkUTCTime (-4712) 1 1 0 0 0 +> assertEqual "testCalTimeToInt64MinDate" expect (pgDatetimetoUTCTime "4713-01-01 00:00:00 BC") + +> testPGDatetimeToUTCTimeMaxDate = do +> let expect = mkUTCTime 999999 1 1 0 0 0 +> assertEqual "testCalTimeToInt64MaxDate" expect (pgDatetimetoUTCTime "999999-01-01 00:00:00+00") + +> testPGDatetimeToUTCTimeBCBoundary = do +> let expect = mkUTCTime 0 1 1 0 0 0 +> assertEqual "testCalTimeToInt64MinDate" expect (pgDatetimetoUTCTime "0001-01-01 00:00:00 BC") + +> testPGDatetimeToUTCTimeBCBoundary2 = do +> let expect = mkUTCTime 0 12 31 0 0 0 +> assertEqual "testCalTimeToInt64MinDate" expect (pgDatetimetoUTCTime "0001-12-31 00:00:00 BC") + +> testUTCTimeToPGDatetimeMinDate = do +> let expect = "4713-01-01 00:00:00.000000+00 BC" +> assertEqual "testCalTimeToInt64MinDate" expect (utcTimeToPGDatetime (mkUTCTime (-4712) 1 1 0 0 0)) + +> testUTCTimeToPGDatetimeMaxDate = do +> let expect = "999999-01-01 00:00:00.300001+00 AD" +> assertEqual "testCalTimeToInt64MinDate" expect (utcTimeToPGDatetime (mkUTCTime 999999 1 1 0 0 0.300001))
+ Database/Util.lhs view
@@ -0,0 +1,262 @@+ +| +Module : Database.Util +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Utility functions. Mostly used in database back-ends, and tests. + + +> {-# OPTIONS -fglasgow-exts #-} +> {-# OPTIONS -fallow-overlapping-instances #-} +> {-# OPTIONS -fallow-undecidable-instances #-} + +> {-# LANGUAGE FlexibleInstances #-} +> {-# LANGUAGE OverlappingInstances #-} +> {-# LANGUAGE UndecidableInstances #-} + +> module Database.Util where + +> import System.Time +> import Control.Monad.Trans (liftIO) +> import Control.Monad.Reader +> import Data.Int +> import Data.List +> import Data.Char +> import Data.Time +> import Text.Printf + + +MyShow requires overlapping AND undecidable instances. + +> class Show a => MyShow a where show_ :: a -> String +> instance MyShow String where show_ s = s +> instance (Show a) => MyShow a where show_ s = show s + +| Like 'System.IO.print', except that Strings are not escaped or quoted. + +> print_ :: (MonadIO m, MyShow a) => a -> m () +> print_ s = liftIO (putStrLn (show_ s)) + +| Convenience for making UTCTimes. Assumes the time given is already UTC time +i.e. there's no timezone adjustment. + +> mkUTCTime :: (Integral a, Real b) => a -> a -> a -> a -> a -> b -> UTCTime +> mkUTCTime year month day hour minute second = +> localTimeToUTC (hoursToTimeZone 0) +> (LocalTime +> (fromGregorian (fromIntegral year) (fromIntegral month) (fromIntegral day)) +> (TimeOfDay (fromIntegral hour) (fromIntegral minute) (realToFrac second))) + +> mkCalTime :: Integral a => a -> a -> a -> a -> a -> a -> CalendarTime +> mkCalTime year month day hour minute second = +> CalendarTime +> { ctYear = fromIntegral year +> , ctMonth = toEnum (fromIntegral month - 1) +> , ctDay = fromIntegral day +> , ctHour = fromIntegral hour +> , ctMin = fromIntegral minute +> , ctSec = fromIntegral second +> , ctPicosec = 0 +> , ctWDay = Sunday +> , ctYDay = -1 +> , ctTZName = "UTC" +> , ctTZ = 0 +> , ctIsDST = False +> } + + +20040822073512 + 10000000000 (10 ^ 10) * year + 100000000 (10 ^ 8) * month + 1000000 (10 ^ 6) * day + 10000 (10^4) * hour + +Use quot and rem, /not/ div and mod, +so that we get sensible behaviour for -ve numbers. + +> int64ToDateParts :: Int64 -> (Int64, Int64, Int64, Int64, Int64, Int64) +> int64ToDateParts i = +> let +> year1 = (i `quot` 10000000000) +> month = ((abs i) `rem` 10000000000) `quot` 100000000 +> day = ((abs i) `rem` 100000000) `quot` 1000000 +> hour = ((abs i) `rem` 1000000) `quot` 10000 +> minute = ((abs i) `rem` 10000) `quot` 100 +> second = ((abs i) `rem` 100) +> in (year1, month, day, hour, minute, second) + +> datePartsToInt64 :: +> (Integral a1, Integral a2, Integral a3, Integral a4, Integral a5, Integral a6) +> => (a1, a2, a3, a4, a5, a6) -> Int64 +> datePartsToInt64 (year, month, day, hour, minute, second) = +> let +> yearm :: Int64 +> yearm = 10000000000 +> sign :: Int64 +> sign = if year < 0 then -1 else 1 +> in yearm * fromIntegral year +> + sign * 100000000 * fromIntegral month +> + sign * 1000000 * fromIntegral day +> + sign * 10000 * fromIntegral hour +> + sign * 100 * fromIntegral minute +> + sign * fromIntegral second + + +> calTimeToInt64 :: CalendarTime -> Int64 +> calTimeToInt64 ct = +> datePartsToInt64 +> ( ctYear ct, fromEnum (ctMonth ct) + 1, ctDay ct +> , ctHour ct, ctMin ct, ctSec ct) + +> utcTimeToInt64 utc = +> let +> (LocalTime ltday time) = utcToLocalTime (hoursToTimeZone 0) utc +> (TimeOfDay hour minute second) = time +> (year, month, day) = toGregorian ltday +> in datePartsToInt64 (year, month, day, hour, minute, round second) + + +> int64ToCalTime :: Int64 -> CalendarTime +> int64ToCalTime i = +> let (year, month, day, hour, minute, second) = int64ToDateParts i +> in mkCalTime year month day hour minute second + +> int64ToUTCTime :: Int64 -> UTCTime +> int64ToUTCTime i = +> let (year, month, day, hour, minute, second) = int64ToDateParts i +> in mkUTCTime year month day hour minute second + + +> zeroPad n i = +> if i < 0 +> then "-" ++ (zeroPad n (abs i)) +> else take (n - length (show i)) (repeat '0') ++ show i + +> substr i n s = take n (drop (i-1) s) + +> wordsBy :: (Char -> Bool) -> String -> [String] +> wordsBy pred s = skipNonMatch pred s + +2 states: +skipNonMatch is for when we are looking for the start of our next word +consumeMatch is for when we are currently scanning a word + +> skipNonMatch :: (Char -> Bool) -> String -> [String] +> skipNonMatch pred "" = [] +> skipNonMatch pred (c:cs) +> | pred c = scanWord pred cs [c] +> | otherwise = skipNonMatch pred cs + +> scanWord pred "" acc = [reverse acc] +> scanWord pred (c:cs) acc +> | pred c = scanWord pred cs (c:acc) +> | otherwise = [reverse acc] ++ skipNonMatch pred cs + + +> positions :: Eq a => [a] -> [a] -> [Int] +> positions [] _ = [] +> positions s ins = map fst (filter (isPrefixOf s . snd) (zip [1..] (tails ins))) + + + 1234567890123456789012345 +"2006-11-24 07:51:49.228+00" +"2006-11-24 07:51:49.228" +"2006-11-24 07:51:49.228 BC" +"2006-11-24 07:51:49+00 BC" + +FIXME use TZ to specify timezone? +Not necessary, PostgreSQL always seems to output ++00 for timezone. It's already adjusted the time, +I think. Need to test this with different server timezones, though. + +> pgDatetimetoUTCTime :: String -> UTCTime +> pgDatetimetoUTCTime s = +> let (year, month, day, hour, minute, second, tz) = pgDatetimeToParts s +> in mkUTCTime year month day hour minute second + +> isoDatetimeToUTCTime s = pgDatetimetoUTCTime s + +> pgDatetimetoCalTime :: String -> CalendarTime +> pgDatetimetoCalTime s = +> let (year, month, day, hour, minute, second, tz) = pgDatetimeToParts s +> in mkCalTime year month day hour minute (round second) + +isInfixOf is defined in the Data.List that comes with ghc-6.6, +but it is not in the libs that come with ghc-6.4.1. + +> myIsInfixOf srch list = or (map (isPrefixOf srch) (tails list)) + +Parses ISO format datetimes, and also the variation that PostgreSQL uses. + +> pgDatetimeToParts :: String -> (Int, Int, Int, Int, Int, Double, Int) +> pgDatetimeToParts s = +> let +> pred c = isAlphaNum c || c == '.' +> ws = wordsBy pred s +> parts :: [Int]; parts = map read (take 5 ws) +> secs :: Double; secs = read (ws!!5) +> hasTZ = myIsInfixOf "+" s +> tz :: Int; tz = if hasTZ then read (ws !! 6) else 0 +> isBC = myIsInfixOf "BC" s +> -- It seems only PostgreSQL uses the AD/BC suffix. +> -- If BC is present then we need to do something odd with the year. +> year :: Int; year = if isBC then (- ((parts !! 0) - 1)) else parts !! 0 +> in (year, (parts !! 1), (parts !! 2) +> , (parts !! 3), (parts !! 4), secs, tz) + + +> utcTimeToIsoString :: (Integral a, Integral b) => +> UTCTime -> String -> (a -> a) -> (b -> String) -> String +> utcTimeToIsoString utc dtSep adjYear mkSuffix = +> let +> (LocalTime ltday time) = utcToLocalTime (hoursToTimeZone 0) utc +> (TimeOfDay hour minute second) = time +> (year1, month, day) = toGregorian ltday +> suffix = mkSuffix (fromIntegral year1) +> year = adjYear (fromIntegral year1) +> s1 :: Double; s1 = realToFrac second +> secs :: String; secs = printf "%09.6f" s1 +> in zeroPad 4 year +> ++ "-" ++ zeroPad 2 month +> ++ "-" ++ zeroPad 2 day +> ++ dtSep ++ zeroPad 2 hour +> ++ ":" ++ zeroPad 2 minute +> ++ ":" ++ secs +> ++ "+00" ++ suffix + +> utcTimeToPGDatetime :: UTCTime -> String +> utcTimeToPGDatetime utc = utcTimeToIsoString utc "T" adjYear mkSuffix +> where +> mkSuffix year1 = if year1 < 1 then " BC" else " AD" +> adjYear year1 = if year1 < 1 then abs(year1 - 1) else year1 + +> utcTimeToIsoDatetime :: UTCTime -> String +> utcTimeToIsoDatetime utc = utcTimeToIsoString utc "T" id (const "Z") + +> utcTimeToOdbcDatetime :: UTCTime -> String +> utcTimeToOdbcDatetime utc = utcTimeToIsoString utc " " id (const "") + + +| Assumes CalendarTime is also UTC i.e. ignores ctTZ component. + +> calTimeToPGDatetime :: CalendarTime -> String +> calTimeToPGDatetime ct = +> let +> (year1, month, day, hour, minute, second, pico, tzsecs) = +> ( ctYear ct, fromEnum (ctMonth ct) + 1, ctDay ct +> , ctHour ct, ctMin ct, ctSec ct, ctPicosec ct, ctTZ ct) +> suffix = if year1 < 1 then " BC" else " AD" +> year = if year1 < 1 then abs(year1 - 1) else year1 +> s1 :: Double; s1 = realToFrac second + ((fromIntegral pico) / (10.0 ^ 12) ) +> secs :: String; secs = printf "%09.6f" s1 +> in zeroPad 4 year +> ++ "-" ++ zeroPad 2 month +> ++ "-" ++ zeroPad 2 day +> ++ " " ++ zeroPad 2 hour +> ++ ":" ++ zeroPad 2 minute +> ++ ":" ++ secs +> ++ "+00" ++ suffix
+ Foreign/C/Test/UTF8.hs view
@@ -0,0 +1,138 @@+ +-- | +-- Module : Foreign.C.Test.UTF8 +-- Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +-- License : BSD-style +-- Maintainer : alistair@abayley.org +-- Stability : experimental +-- Portability : non-portable +-- +-- UTF8 decoder and encoder tests. + +module Foreign.C.Test.UTF8 where + +import Control.Exception +import Data.Char +import Foreign.C.String +import Foreign.C.UTF8 +import Foreign.Marshal.Array +import Foreign.Ptr +import Test.MiniUnit +import qualified Test.QuickCheck as QC +import Word (Word8) + + +runTest :: a -> [String] -> IO () +runTest _ args = runTestTT "UTF8" mkTestList >> return () + +--mkTestList :: Test +--mkTestList = TestList (map TestCase testlist) +mkTestList = testlist + +testlist :: [IO ()] +testlist = + [ testUTF8RoundTrip + , testUTF8StringLenRoundTrip + , quickCheckUTF8RoundTrip + , testFromUTF8Failure5Bytes + , testFromUTF8Failure6Bytes + -- , testLargeFromUTF8 + -- , testLargeFromUTF8Len + ] + + +instance QC.Arbitrary Char where + arbitrary = QC.choose (chr 1, chr 0x10FFFF) + coarbitrary = undefined + +prop_roundtrip s = s == fromUTF8 (toUTF8 s) +quickCheckUTF8RoundTrip = QC.test prop_roundtrip + +testUTF8RoundTrip = do + utf8RoundTrip "1ByteLow" 0x000001 [0x01] + utf8RoundTrip "1ByteHigh" 0x00007F [0x7F] + utf8RoundTrip "2BytesLow" 0x000080 [0xC2, 0x80] + utf8RoundTrip "2BytesHigh" 0x0007FF [0xDF, 0xBF] + utf8RoundTrip "3BytesLow" 0x000800 [0xE0, 0xA0, 0x80] + utf8RoundTrip "3BytesHigh" 0x00FFFF [0xEF, 0xBF, 0xBF] + utf8RoundTrip "4BytesLow" 0x010000 [0xF0, 0x90, 0x80, 0x80] + -- chr 0x10FFFF is the largest code-point Haskell currently allows + utf8RoundTrip "4BytesHigh" 0x10FFFF [0xF4, 0x8F, 0xBF, 0xBF] + +utf8RoundTrip :: String -> Int -> [Word8] -> IO () +utf8RoundTrip msg unicode utf8 = do + assertEqual ("testToUTF8-" ++ msg) utf8 (toUTF8 [chr unicode]) + assertEqual ("testFromUTF8-" ++ msg) [chr unicode] (fromUTF8 utf8) + withUTF8String [chr unicode] $ \cstr -> do + w8 <- peekArray0 0 (castPtr cstr) + assertEqual ("testToUTF8Ptr-" ++ msg) utf8 w8 + withCString (map (chr . fromIntegral) utf8) $ \cstr -> do + s <- peekUTF8String cstr + assertEqual ("testFromUTF8Ptr-" ++ msg) [chr unicode] s + +testUTF8StringLenRoundTrip = do + utf8StringLenRoundTrip "1ByteLow" [0x000001, 0x000001] [0x01, 0x01] + utf8StringLenRoundTrip "2BytesLow" [0x000080, 0x00007F] [0xC2, 0x80, 0x7F] + utf8StringLenRoundTrip "3BytesLow" [0x000800, 0x000001] [0xE0, 0xA0, 0x80, 0x01] + utf8StringLenRoundTrip "4BytesLow" [0x010000, 0x00007F] [0xF0, 0x90, 0x80, 0x80, 0x7F] + utf8StringLenRoundTrip "4BytesHigh" [0x10FFFF, 0x00007F] [0xF4, 0x8F, 0xBF, 0xBF, 0x01] + +utf8StringLenRoundTrip :: String -> [Int] -> [Word8] -> IO () +utf8StringLenRoundTrip msg codepoints utf8 = do + let unicode = map chr codepoints + let expect = take (length unicode - 1) unicode + -- convert our unicode code-points (Haskell String) + -- into a UTF8 CStringLen. + -- Pass this back to peekUTF8StringLen to convert back into Haskell String. + -- Chop off the last char - make sure it's only one byte. + withUTF8StringLen unicode $ \(cstr, clen) -> do + assertEqual ("testUTF8StringLenRoundTrip-" ++ msg) (length utf8) clen + s <- peekUTF8StringLen (cstr, clen - 1) + assertEqual ("testUTF8StringLenRoundTrip-" ++ msg) expect s + + + +--testUTF8StringLenRoundTrip = do + + +testFromUTF8Failure5Bytes = do + let utf8 = [0xF8, 0x80, 0x80, 0x80, 0x80] + catchJust errorCalls (do + assertEqual "testFromUTF8Failure5Bytes" [chr 0x10FFFF] (fromUTF8 utf8) + assertBool "testFromUTF8Failure5Bytes: no error raised" False + ) (\msg -> do + assertEqual "testFromUTF8Failure5Bytes" "fromUTF8: illegal UTF-8 character 248" msg + ) + +testFromUTF8Failure6Bytes = do + let utf8 = [0xFD, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF] + catchJust errorCalls (do + assertEqual "testFromUTF8Failure6Bytes" [chr 0x10FFFF] (fromUTF8 utf8) + assertBool "testFromUTF8Failure6Bytes: no error raised" False + ) (\msg -> do + assertEqual "testFromUTF8Failure6Bytes" "fromUTF8: illegal UTF-8 character 253" msg + ) + +{- +testLargeFromUTF8 = do + let sz = 1000000 + withCString (take sz (repeat 'a')) $ \cstr -> do + s <- peekUTF8String cstr + assertEqual "testLargeFromUTF8" sz (length s) + s <- peekUTF8StringB cstr + assertEqual "testLargeFromUTF8B" sz (length s) + s <- peekUTF8StringLen (cstr, sz) + assertEqual "testLargeFromUTF8Len" sz (length s) + s <- peekUTF8StringLenB (cstr, sz) + assertEqual "testLargeFromUTF8LenB" sz (length s) +-} + +{- +testLargeFromUTF8Len = do + let sz = 1000000 + withCStringLen (take sz (repeat 'a')) $ \(cstr, clen) -> do + putStrLn "testLargeFromUTF8Len: call peekUTF8StringLen" + s <- peekUTF8StringLen (cstr, clen) + putStrLn "testLargeFromUTF8Len: assert length" + assertEqual "testLargeFromUTF8Len" sz (length s) +-}
+ Foreign/C/UTF8.hs view
@@ -0,0 +1,380 @@+ +{-# OPTIONS_GHC -cpp #-} +{-# LANGUAGE CPP #-} + +-- | +-- Module : Foreign.C.UTF8 +-- Copyright : (c) 2004 John Meacham, Alistair Bayley +-- License : BSD-style +-- Maintainer : alistair@abayley.org +-- Stability : experimental +-- Portability : portable +-- +-- Marshall Haskell Strings to and from UTF8-encoded CStrings. +-- This module's code is inspired by John Meacham's UTF8 en- & de-coders, +-- and also those found in the HXT library (module Text.XML.HXT.DOM.Unicode). +-- +-- Note that the -Len functions all return the length in bytes, +-- not Chars (this is more useful, as you are most likely to want +-- to pass the length to an FFI function, which is most likely +-- expecting the length in bytes). If you want the length in Chars, +-- well, you have the original String, so... + + +module Foreign.C.UTF8 + ( peekUTF8String, peekUTF8StringLen + , newUTF8String, withUTF8String, withUTF8StringLen + , toUTF8String, fromUTF8String + , lengthUTF8, fromUTF8, toUTF8 + ) where + +import Control.Monad (when, liftM) +import Data.Bits +import Data.Char +import Data.Word (Word8) +import Foreign.C.Types +import Foreign.C.String +import Foreign.Ptr +import Foreign.Marshal.Array +import Foreign.Storable + +#ifdef __GLASGOW_HASKELL__ +import GHC.Base (unsafeChr) +#else +unsafeChr :: Int -> Char +unsafeChr i = chr i +#endif + + +nullCChar :: CChar +nullCChar = 0 + +nullByte :: Word8 +nullByte = 0 + +-- | Analogous to peekCString. Converts UTF8 CString to String. +peekUTF8String :: CString -> IO String +peekUTF8String cs = fromUTF8Ptr0 (castPtr cs) +--peekUTF8String cs = peekArray0 nullByte (castPtr cs) >>= return . fromUTF8 + +-- | Analogous to peekCStringLen. Converts UTF8 CString to String. +-- The resulting String will end either when @len@ bytes +-- have been converted, or when a NULL is found. +peekUTF8StringLen :: CStringLen -> IO String +peekUTF8StringLen (cs, len) = fromUTF8Ptr (len-1) (castPtr cs) "" +--peekUTF8StringLen (cs, len) = peekArray len (castPtr cs) >>= return . fromUTF8 + +-- | Analogous to newCString. Creates UTF8 encoded CString. +newUTF8String :: String -> IO CString +newUTF8String hs = do + p <- newArray0 nullByte (toUTF8 hs) + return (castPtr p) + +-- | Analogous to newCStringLen. +-- The length returned is in bytes (encoding units), not chars. +newUTF8StringLen :: String -> IO CStringLen +newUTF8StringLen hs = do + let utf8 = toUTF8 hs + p <- newArray0 nullByte utf8 + return (castPtr p, length utf8) + +-- | Analogous to withCString. Creates UTF8 encoded CString. +withUTF8String :: String -> (CString -> IO a) -> IO a +withUTF8String s action = + withUTF8StringLen s (\(cstr, _) -> action cstr) + +-- | Analogous to withCStringLen. +-- The length returned is in bytes (encoding units), not chars. +withUTF8StringLen :: String -> (CStringLen -> IO a) -> IO a +withUTF8StringLen s action = do + let utf8 = toUTF8 s + withArray0 nullByte utf8 + (\arr -> action (castPtr arr, length utf8) ) + +-- | Convert a String that was marshalled from a CString without +-- any decoder applied. This might be useful if the client encoding +-- is unknown, and the user code must convert. +-- We assume that the UTF8 CString was marshalled as if Latin-1 +-- i.e. all chars are in the range 0-255. +fromUTF8String :: String -> String +fromUTF8String = fromUTF8 . map charToWord8 + +charToWord8 :: Char -> Word8 +charToWord8 = fromIntegral . fromEnum + +-- | Convert a Haskell String into a UTF8 String, where each UTF8 byte +-- is represented by its Char equivalent i.e. only chars 0-255 are used. +-- The resulting String can be marshalled to CString directly i.e. with +-- a Latin-1 encoding. +toUTF8String :: String -> String +toUTF8String = map word8ToChar . toUTF8 + +word8ToChar :: Word8 -> Char +word8ToChar = unsafeChr . fromIntegral + + +lengthUTF8 :: String -> Int +lengthUTF8 s = length (toUTF8 s) + +{- +The codepoint-to-UTF8 rules: +0x00 - 0x7f: 7 bits: as is +0x80 - 0x07ff: 11 bits + byte 1: 0xC0 OR ((x << 6) AND 0x1F) i.e. 0xC0 + bits 7-11 (bits 12-up are 0) + byte 2: 0x80 OR (x AND 0x3F) i.e. 0x80 + bits 1-6 +0x0800 - 0xFFFF: 16 bits + byte 1: 0xE0 OR ((x << 12) AND 0x0F) i.e. 0xE0 + bits 13-16 + byte 2: 0x80 OR ((x << 6) AND 0x3F) i.e. 0x80 + bits 7-12 + byte 3: 0x80 OR (x AND 0x3F) i.e. 0x80 + bits 1-6 +0x00010000 - 0x001FFFFF: 21 bits + byte 1: 0xF0 OR ((x << 18) AND 0x07) i.e. 0xF0 + bits 19-21 + byte 2: 0x80 OR ((x << 12) AND 0x3F) i.e. 0x80 + bits 13-18 + byte 3: 0x80 OR ((x << 6) AND 0x3F) i.e. 0x80 + bits 7-12 + byte 4: 0x80 OR (x AND 0x3F) i.e. 0x80 + bits 1-6 +0x00200000 - 0x03FFFFFF: 26 bits + byte 1: 0xF8 OR ((x << 24) AND 0x03) i.e. 0xF8 + bits 25-26 + byte 2: 0x80 OR ((x << 18) AND 0x3F) i.e. 0x80 + bits 19-24 + byte 3: 0x80 OR ((x << 12) AND 0x3F) i.e. 0x80 + bits 13-18 + byte 4: 0x80 OR ((x << 6) AND 0x3F) i.e. 0x80 + bits 7-12 + byte 5: 0x80 OR (x AND 0x3F) i.e. 0x80 + bits 1-6 +0x04000000 - 0x7FFFFFFF: 31 bits + byte 1: 0xFC OR ((x << 30) AND 0x01) i.e. 0xFC + bit 31 + byte 2: 0x80 OR ((x << 24) AND 0x3F) i.e. 0x80 + bits 25-30 + byte 3: 0x80 OR ((x << 18) AND 0x3F) i.e. 0x80 + bits 19-24 + byte 4: 0x80 OR ((x << 12) AND 0x3F) i.e. 0x80 + bits 13-18 + byte 5: 0x80 OR ((x << 6) AND 0x3F) i.e. 0x80 + bits 7-12 + byte 6: 0x80 OR (x AND 0x3F) i.e. 0x80 + bits 1-6 +-} + +-- | Convert Unicode characters to UTF-8. +toUTF8 :: String -> [Word8] +toUTF8 [] = [] +toUTF8 (x:xs) = toUTF8' (ord x) where + toUTF8' x + | x <= 0x0000007F = fromIntegral x : more + | x <= 0x000007FF + = w8 0xC0 6 : w8 0x80 0 : more + | x <= 0x0000FFFF + = w8 0xE0 12 : w8 0x80 6 : w8 0x80 0 : more + -- If we want to encode chars > 1114111 then this test should be + -- x <= 0x001FFFFF + -- because that's the upper limit of the 4-byte encoding + -- (and the 5- and 6-byte cases below might also be enabled). + | x <= 0x0010FFFF + = w8 0xF0 18 : w8 0x80 12 : w8 0x80 6 : w8 0x80 0 : more + | otherwise = error ("toUTF8: codepoint " ++ show x + ++ " is greater than the largest allowed (decimal 1114111, hex 0x10FFFF).") + {- + -- Potentially useful code, if Haskell ever supports codepoints > 0x0010FFFF. + -- There are no tests for this, because we can't create Strings containing + -- chars > 0x0010FFFF. + | x <= 0x03FFFFFF + = w8 0xF8 24 : w8 0x80 18 : w8 0x80 12 : w8 0x80 6 : w8 0x80 0 : more + | x <= 0x7FFFFFFF + = w8 0xFC 30 : w8 0x80 24 : w8 0x80 18 : w8 0x80 12 : w8 0x80 6 : w8 0x80 0 : more + | otherwise = error ("toUTF8: codepoint " ++ show x ++ " is greater " + ++ "then the largest that can be represented by UTF8 encoding" + ++ "(decimal 2147483647, hex 0x7FFFFFFF).") + -} + where + more = toUTF8 xs + w8 :: Word8 -> Int -> Word8 + w8 base rshift = base .|. (fromIntegral (shiftR x rshift) .&. mask) + where + mask + | base == 0x80 = 0x3F + | base == 0xC0 = 0x1F + | base == 0xE0 = 0x0F + | base == 0xF0 = 0x07 + | base == 0xF8 = 0x03 + | base == 0xFC = 0x01 + +{- +And the rules for UTF8-to-codepoint: +examine first byte: +0x00-0x7F: 1 byte: as-is +0x80-0xBF: error (surrogate) +0xC0-0xDF: 2 bytes: b1 AND 0x1F + remaining +0xE0-0xEF: 3 bytes: b1 AND 0x0F + remaining +0xF0-0xF7: 4 bytes: b1 AND 0x07 + remaining +0xF8-0xFB: 5 bytes: b1 AND 0x03 + remaining +0xFC-0xFD: 6 bytes: b1 AND 0x01 + remaining +0xFE-0xFF: error + (byte-order-mark indicators: UTF8 - EFBBBF, UTF16 - FEFF or FFFE) +remaining = lower 6 bits of each byte, concatenated +-} + +-- | Convert UTF-8 to Unicode. +fromUTF8 :: [Word8] -> String +fromUTF8 [] = "" +fromUTF8 (x:xs) + | x <= 0x7F = remaining 0 (fromIntegral x) xs + | x <= 0xBF = err x + | x <= 0xDF = remaining 1 (bAND x 0x1F) xs + | x <= 0xEF = remaining 2 (bAND x 0x0F) xs + | x <= 0xF7 = remaining 3 (bAND x 0x07) xs + | otherwise = err x + {- + -- Again, only works for chars > 0x0010FFFF, which we can't test. + | x <= 0xFB = remaining 4 (bAND x 0x03) xs + | x <= 0xFD = remaining 5 (bAND x 0x01) xs + | otherwise = err x + -} + where + err x = error ("fromUTF8: illegal UTF-8 character " ++ show x) + bAND :: Word8 -> Word8 -> Int + bAND x m = fromIntegral (x .&. m) + remaining :: Int -> Int -> [Word8] -> String + remaining 0 x xs = chr x : fromUTF8 xs + remaining n x [] = error "fromUTF8: incomplete UTF8 sequence" + remaining n x (b:xs) + | b == 0 = err x + | otherwise = remaining (n-1) ((shiftL x 6) .|. (bAND b 0x3F)) xs + +{- +We should be able to write a version of fromUTF8Ptr which starts at +the end of the array and works backwards. +This will allow us to create the result String with constant space +usage. Contrast this with creating the String by processing the array +from start to end: in this case we would probably use an accumulating +parameter, and reverse the list when we reach the end of the array. +This isn't so bad, if we expect reverse to work in constant space +(more or less). +-} + +-- | Convert UTF-8 to Unicode, from a null-terminated C array of bytes. +-- This function is useful, in addition to 'fromUTF8' above, +-- because it doesn't create an intermediate @[Word8]@ list. +fromUTF8Ptr0 :: Ptr Word8 -> IO String +fromUTF8Ptr0 p = do + len <- lengthArray0 nullByte p + --fromUTF8PtrUnboxed (len-1) p "" + fromUTF8Ptr (len-1) p "" + +-- | The bytes parameter should be len-1 +-- i.e. if the CString has length 2, then you should pass +-- bytes=1. +fromUTF8Ptr :: Int -> Ptr Word8 -> String -> IO String +fromUTF8Ptr bytes p acc + | () `seq` bytes `seq` p `seq` acc `seq` False = undefined + | bytes < 0 = do + if null acc then return acc + else -- BOM = chr 65279 ( EF BB BF ) + if head acc /= chr 65279 then return acc + else return (tail acc) + | otherwise = do + x <- liftM fromIntegral (peekElemOff p bytes) + case () of + _ | x == 0 -> error ("fromUTF8Ptr: zero byte found in string as position " ++ show bytes) + | x <= 0x7F -> fromUTF8Ptr (bytes-1) p (unsafeChr x:acc) + | x <= 0xBF && bytes == 0 -> error "fromUTF8Ptr: surrogate at start of string" + | x <= 0xBF -> fromUTF8Ptr (bytes-1) p acc + | otherwise -> do + c <- readUTF8Char x bytes p + fromUTF8Ptr (bytes-1) p (c:acc) + + +readUTF8Char :: Int -> Int -> Ptr Word8 -> IO Char +readUTF8Char x offset p + | () `seq` x `seq` offset `seq` p `seq` False = undefined + | otherwise = + case () of + _ | x == 0 -> err x + | x <= 0x7F -> return (unsafeChr x) + | x <= 0xBF -> err x + | x <= 0xDF -> do + x1 <- liftM fromIntegral (peekElemOff p (offset + 1)) + return (unsafeChr ( + ((x - 0xC0) * 64) + + (x1 - 0x80) + )) + | x <= 0xEF -> do + x1 <- liftM fromIntegral (peekElemOff p (offset + 1)) + x2 <- liftM fromIntegral (peekElemOff p (offset + 2)) + return (unsafeChr ( + ((x - 0xE0) * 4096) + + ((x1 - 0x80) * 64) + + (x2 - 0x80) + )) + | x <= 0xF7 -> do + x1 <- liftM fromIntegral (peekElemOff p (offset + 1)) + x2 <- liftM fromIntegral (peekElemOff p (offset + 2)) + x3 <- liftM fromIntegral (peekElemOff p (offset + 3)) + return (unsafeChr ( + ((x - 0xF0) * 262144) + + ((x1 - 0x80) * 4096) + + ((x2 - 0x80) * 64) + + (x3 - 0x80) + )) + | otherwise -> err x + where + err x = error ("readUTF8Char: illegal UTF-8 character " ++ show x) + + +--------------------------------------------------------------------- +-- Unboxed versions - GHC only? + +{- + +-# OPTIONS_GHC -fglasgow-exts #- +import GHC.Ptr (Ptr(..)) + +fromUTF8PtrUnboxed :: Int -> Ptr Word8 -> String -> IO String +fromUTF8PtrUnboxed (I# bytes) (Ptr addr) acc = fromUTF8Ptr# bytes addr acc + + +fromUTF8Ptr# :: Int# -> Addr# -> String -> IO String +fromUTF8Ptr# offset ptrbase acc + | offset <# 0# = return acc + | otherwise = do + case () of + _ | x ==# 0# -> + error ("fromUTF8Ptr#: zero byte in string at position " ++ show (I# x)) + | x <=# 0x7F# -> fromUTF8Ptr# (offset -# 1#) ptrbase ((C# (chr# x)):acc) + | x <=# 0xBF# && offset ==# 0# -> + error "fromUTF8Ptr#: surrogate at start of string" + | x <=# 0xBF# -> fromUTF8Ptr# (offset -# 1#) ptrbase acc + | otherwise -> do + c <- readUTF8Char# x offset ptrbase + fromUTF8Ptr# (offset -# 1#) ptrbase (c:acc) + where + x = word2Int# (indexWord8OffAddr# ptrbase offset) + + +readUTF8Char# :: Int# -> Int# -> Addr# -> IO Char +readUTF8Char# x offset p = do + case () of + _ | x ==# 0# -> err x + | x <=# 0x7F# -> return (C# (chr# x)) + | x <=# 0xBF# -> err x + | x <=# 0xDF# -> do + let x1 = word2Int# (indexWord8OffAddr# p (offset +# 1#)) + return + (C# (chr# ( + (uncheckedIShiftL# (x -# 0xC0#) 6#) + +# (x1 -# 0x80#) + ))) + | x <=# 0xEF# -> do + let x1 = word2Int# (indexWord8OffAddr# p (offset +# 1#)) + let x2 = word2Int# (indexWord8OffAddr# p (offset +# 2#)) + return + (C# (chr# ( + (uncheckedIShiftL# (x -# 0xE0#) 12#) + +# (uncheckedIShiftL# (x1 -# 0x80#) 6#) + +# (x2 -# 0x80#) + ))) + | x <=# 0xF7# -> do + let x1 = word2Int# (indexWord8OffAddr# p (offset +# 1#)) + let x2 = word2Int# (indexWord8OffAddr# p (offset +# 2#)) + let x3 = word2Int# (indexWord8OffAddr# p (offset +# 3#)) + return + (C# (chr# ( + (uncheckedIShiftL# (x -# 0xF0#) 18#) + +# (uncheckedIShiftL# (x1 -# 0x80#) 12#) + +# (uncheckedIShiftL# (x2 -# 0x80#) 6#) + +# (x3 -# 0x80#) + ))) + | otherwise -> err x + where + err x = error ("readUTF8Char: illegal UTF-8 character " ++ show (I# x)) +-}
+ LICENSE view
@@ -0,0 +1,31 @@+The Takusen License + +Copyright 2004, Oleg Kiselyov, Alistair Bayley. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the copyright holder(s) nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Main.lhs view
@@ -0,0 +1,70 @@+ +| +Module : Main +Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +License : BSD-style +Maintainer : oleg@pobox.com, alistair@abayley.org +Stability : experimental +Portability : non-portable + +Simple driver module, mainly for testing. +Imports test modules and runs test suites. + +This project is now hosted at haskell.org: + +@darcs get <http://darcs.haskell.org/takusen>@ + +Invoke main like this (assuming the compiled executable is called @takusen@): + + > takusen stub noperf + > takusen sqlite noperf "" "" dbname + > takusen oracle noperf "" "" dbname -- no username, so os-authenticated + > takusen mssql noperf user paswd dbname + + +> module Main (main) where + + +> import Database.Sqlite.Test.Enumerator as Sqlite +> import Database.Oracle.Test.Enumerator as Oracle +> --import Database.Test.MultiConnect as Multi +> import Database.ODBC.Test.Enumerator as ODBC +> import Database.Stub.Test.Enumerator as Stub +> --import Database.MSSqlServer.Test.Enumerator as MSSql +> import Database.PostgreSQL.Test.Enumerator as PGSql +> import System.Environment (getArgs) +> import Database.Test.Performance as Perf +> import Database.Test.Util as Util +> import Foreign.C.Test.UTF8 as UTF8 + + +> main :: IO () +> main = do +> args <- getArgs +> if (length args < 2) +> then showUsage +> else do +> let (impl:perf:as) = args +> doTests impl perf as + +> showUsage = do +> putStrLn "usage: takusen backend {no}perf user pswd database" + +> doTests impl perf args = do +> let runPerf = if perf == "perf" then Perf.RunTests else Perf.Don'tRunTests +> case lookup impl backendTests of +> Nothing -> putStrLn $ "No backend for " ++ impl ++ "." +> Just test -> test runPerf args + +> backendTests :: [(String, Perf.ShouldRunTests -> [String] -> IO ())] +> backendTests = +> [ ("sqlite", Sqlite.runTest) +> , ("pgsql", PGSql.runTest) +> , ("odbc", ODBC.runTest) +> --, ("mssql", MSSql.runTest) +> , ("oracle", Oracle.runTest) +> --, ("multi", Multi.runTest) +> , ("stub", Stub.runTest) +> , ("utf8", UTF8.runTest) +> , ("util", Util.runTest) +> ]
+ README.txt view
@@ -0,0 +1,155 @@+Installing +---------- +Prerequisites: GHC >= 6.6, Cabal >= 1.1.6, filepath + +(it's possible to use Takusen with GHC-6.4 and Cabal-1.1.4; +see notes in separate section below) + +To run or build Setup.hs you will need filepath installed. +This is only needed by Setup.hs, and is not required by Takusen itself. + +Ensure that the database libraries for any particular database you plan +to use are in your path e.g. ensure that %ORA_HOME%\bin is in your path. +If the library is not in your path, then it won't be detected in the +configure step, and Takusen won't be able to use it. +You can fix this by adding it to your path and going through the +configure/build/install cycle again. + +Typical build, after unzipping the distribution archive (Takusen-?.?.gz): + $ ghc --make Setup + $ Setup configure + $ Setup build + $ Setup install + +Typical build, using darcs to get latest code: + $ mkdir takusen + $ cd takusen + $ darcs get http://darcs.haskell.org/takusen + $ ghc --make Setup + $ Setup configure + $ Setup build + $ Setup install + + + +Using i.e. Writing data access code +----------------------------------- +There are extensive instructions and examples in the Haddock docs +for module Database.Enumerator: + http://darcs.haskell.org/takusen/doc/html/Database-Enumerator.html + +This should give you most, if not all, of the information you need to +create a program that uses Takusen. + +Here's a little hello-world test case that uses Sqlite: + +{-# OPTIONS -fglasgow-exts #-} +{-# OPTIONS -fallow-overlapping-instances #-} +module Main where +import Database.Sqlite.Enumerator +import Control.Monad.Trans (liftIO) +main = flip catchDB reportRethrow $ + withSession (connect "sqlite_db") (do + let iter (s::String) (_::String) = result s + result <- doQuery (sql "select 'Hello world.'") iter "" + liftIO (putStrLn result) + ) + +If this is Main.hs, then + $ ghc --make Main -o hello +should build a "hello" executable. + + + +Paths, GHCi & runhaskell +------------------------ +Just as with ensuring that your path is correctly set when building Takusen, +you must also ensure it is correctly set when building your programs. +If it is not correct, then you are likely to see linker errors. + +Note that the Cabal build script detects which back-ends are installed by +looking for certain executables in your path. The script modifies the +package description in the build stage so that it only builds libraries +for the back-ends it detects. If you install a new back-end, you will +need to re-run the installation process in order for Takusen to use it. + + + +PostgreSQL gotchas on Windows +----------------------------- +The PostgreSQL client library is called libpq.dll on Windows, rather than +the more typical pq.dll. This is fine when using ghc to compile, as gnu ld +is able to figure out that this is the library to use when you pass it -lpq, +but ghci is not quite so slick, and it fails to load the library. + +There is any easy workaround, which is to copy libpq.dll and rename it to +pq.dll. If you do this, then you should be able to use ghci with PostgreSQL +without problems. Don't forget to ensure that PostgreSQL's bin is in your path. + +In the past I've had problems with older versions of PostgreSQL and +ghc-6.4.1. Specifically, the call to PQprepare would segfault. +This occured with C programs (i.e. no Haskell) compiled with the gcc +and ld that came with ghc-6.4.1. If ld (version 2.15.91) was replaced +with an older one (2.13.91) from MSYS then the test program worked. + +With PostgreSQL 8.1.5.1 and ghc-6.6 (gcc 3.4.5 (mingw special) +and ld 2.15.94) this problem seems to have vanished. + + + +Oracle gotchas on Windows +------------------------- +Some users have reported linker errors because their Oracle bin contains +hsbase.dll, which is an Oracle library related to Heterogenous Services. +This DLL overrides GHC's HSbase.dll, and therefore causes linker errors. + +If you can control your Oracle client installation then either + - don't choose Heterogenous Services when you install, + or re-run the installer and remove it, or + - rename hsbase.dll in Oracle bin. + + + +GHC-6.4 and Takusen +------------------- +It is possible to use Takusen with GHC-6.4. We have tested with Cabal-1.1.4, +so you aren't required to upgrade to 1.1.6 (but it won't hurt, either). +If you use Cabal-1.1.4, then you should use the Setup-114.hs script. +If you use Cabal-1.1.6, then you should use the normal Setup.hs script. + +You will need to install Data.Time, which is quite a chore on Windows +because of the dependencies. You will also need MSYS installed in order +to be able to run autoreconf, so get that out of the way first. + +The summary for Windows is: + +darcs get --partial http://www-users.cs.york.ac.uk/~ndm/filepath/ +(or download and unzip the prepared distribution) +normal cabal configure, build, install + +darcs get --partial http://www.cse.unsw.edu.au/~dons/code/fps +(or download and unzip the prepared distribution) +normal cabal configure, build, install + +darcs get http://darcs.haskell.org/packages/Win32 +Edit Win32.cabal, add fps to build-depends. +normal cabal configure, build, install + +darcs get http://semantic.org/TimeLib/TimeLib +There are two packages here: time and fixed. Ignore time. +Go into fixed and do cabal configure, build, install + +darcs get http://darcs.haskell.org/packages/time +Edit time.cabal, add fixed and Win32 to build-depends. +create Setup.hs: + import Distribution.Simple + main = defaultMainWithHooks defaultUserHooks +From MSYS shell, not Windows cmd.exe: + $ autoreconf + $ ghc --make Setup + $ Setup configure + $ Setup build + $ Setup install + +And finally, build Takusen with the normal cabal configure, +build, install.
+ Setup-114.hs view
@@ -0,0 +1,228 @@+-- #!/usr/bin/env runhaskell + +{-# OPTIONS -cpp #-} +{-# LANGUAGE CPP #-} + +-- Can't use "#!" with -cpp; get "invalid preprocessing directive #!" + +-- This Setup script is for cabal-1.1.4. + +import Distribution.Setup (InstallUserFlag(..)) +import Distribution.Simple +import Distribution.Simple.Build (build) +import Distribution.Simple.Configure (LocalBuildInfo(..)) +import Distribution.Simple.Install (install) +import Distribution.Simple.Register (register, writeInstalledConfig) +import Distribution.PreProcess (PPSuffixHandler, knownSuffixHandlers) +import Distribution.PackageDescription (HookedBuildInfo, BuildInfo + , emptyHookedBuildInfo, writeHookedBuildInfo, emptyBuildInfo + , extraLibs, extraLibDirs, includeDirs) +import Distribution.Simple.Configure (findProgram) +import Distribution.Simple.LocalBuildInfo (LocalBuildInfo) +import Distribution.Setup (ConfigFlags, configVerbose) +import Distribution.PackageDescription + ( HookedBuildInfo, emptyHookedBuildInfo, PackageDescription + , writeHookedBuildInfo, Library(..), library, extraLibs + , hasLibs, emptyBuildInfo, extraLibDirs, includeDirs, BuildInfo(..) + ) +import Distribution.Setup (ConfigFlags, configVerbose + , InstallFlags(..), CopyFlags(..), CopyDest(..) +-- , emptyRegisterFlags, regUser, regVerbose + ) +import System.Directory (removeFile, getTemporaryDirectory, canonicalizePath) +import System.Process(runProcess, waitForProcess) +import System.IO(hClose, openFile, hGetLine, hIsEOF, openTempFile, IOMode(..)) +import System.Exit (ExitCode(..), exitWith) +import System.FilePath (splitFileName, combine) +import Control.Exception (try, bracket) +import Control.Monad (when) +import Data.List (isPrefixOf, unionBy) + + +main = defaultMainWithHooks defaultUserHooks + { preConf=preConf, postConf=postConf, buildHook=buildHook, instHook=installHook } + where + preConf :: [String] -> ConfigFlags -> IO HookedBuildInfo + preConf args flags = do + try (removeFile "takusen.buildinfo") + return emptyHookedBuildInfo + postConf :: [String] -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode + postConf args flags _ localbuildinfo = do + let verbose = configVerbose flags + sqliteBI <- configSqlite3 verbose + pgBI <- configPG verbose + oraBI <- configOracle verbose + odbcBI <- configOdbc verbose + let bis = [sqliteBI, pgBI, oraBI, odbcBI] + writeHookedBuildInfo "takusen.buildinfo" (concatBuildInfo bis,[]) + return ExitSuccess + -- We patch in the buildHook so that we can modify the list of exposed + -- modules (we remove modules for back-ends that are not installed). + buildHook :: PackageDescription -> LocalBuildInfo -> Int -> [PPSuffixHandler] -> IO () + buildHook pd lbi mbuh bf = defaultBuildHook (modifyPackageDesc pd) lbi mbuh bf + -- also patch the installHook + installHook :: PackageDescription -> LocalBuildInfo -> Int -> InstallUserFlag -> IO () + installHook pd lbi mbuh insf = defaultInstallHook (modifyPackageDesc pd) lbi mbuh insf + +modifyPackageDesc pd = + let + Just (Library modules buildInf) = library pd + filteredMods = filterModulesByLibs modules (extraLibs buildInf) + in pd { library = Just (Library filteredMods buildInf) } + +filterModulesByLibs modules libs = + removeModulesForAbsentLib "pq" "Database.PostgreSQL" libs + . removeModulesForAbsentLib "oci" "Database.Oracle" libs + . removeModulesForAbsentLib "sqlite3" "Database.Sqlite" libs + . filterODBCModules libs + $ modules + +removeModulesForAbsentLib lib prefix libs modules = + if not (elem lib libs) + then filter (not . isPrefixOf prefix) modules + else modules + +filterODBCModules libs modules = + if not (elem "odbc" libs || elem "odbc32" libs) + then filter (not . isPrefixOf "Database.ODBC") modules + else modules + +--------------------------------------------------------------------- +-- Start of code copied verbatim from Distribution.Simple, +-- because it's not exported. + +defaultInstallHook pkg_descr localbuildinfo verbose uInstFlag = do + let uInst = case uInstFlag of + InstallUserUser -> True + InstallUserGlobal -> False --over-rides configure setting + -- no flag, check how it was configured: + InstallUserNone -> userConf localbuildinfo + install pkg_descr localbuildinfo (NoCopyDest, verbose) + when (hasLibs pkg_descr) + (register pkg_descr localbuildinfo (uInst, False, verbose)) + +defaultBuildHook pkg_descr localbuildinfo flags pps = do + build pkg_descr localbuildinfo flags pps + when (hasLibs pkg_descr) $ + writeInstalledConfig pkg_descr localbuildinfo + +allSuffixHandlers :: Maybe UserHooks -> [PPSuffixHandler] +allSuffixHandlers hooks + = maybe knownSuffixHandlers + (\h -> overridesPP (hookedPreProcessors h) knownSuffixHandlers) + hooks + where + overridesPP :: [PPSuffixHandler] -> [PPSuffixHandler] -> [PPSuffixHandler] + overridesPP = unionBy (\x y -> fst x == fst y) +-- End of code copied verbatim from Distribution.Simple. +--------------------------------------------------------------------- + +{- +dropLastElementFromPath path = reverse . dropWhile (\c -> c /= '\\' && c /= '/') . reverse $ path +joinPaths path item = + let lastChar = last path + in + if lastChar == '\\' || lastChar == '/' + then path ++ item + else path ++ "/" ++ item +sameFolder path = return (dropLastElementFromPath path) +parentFolder path = canonicalizePath (dropLastElementFromPath (dropLastElementFromPath path)) +-} + +joinPaths = combine +sameFolder path = return (fst (splitFileName path)) +parentFolder path = canonicalizePath (fst (splitFileName path) ++ "/..") + + +makeConfig path libName libDir includeDir = do + libDirs <- canonicalizePath (joinPaths path libDir) + includeDirs <- canonicalizePath (joinPaths path includeDir) + return (Just emptyBuildInfo + { extraLibs = [libName] + , extraLibDirs = [libDirs] + , includeDirs = [includeDirs] + } + ) + +message s = putStrLn ("configure: takusen: " ++ s) + +createConfigByFindingExe desc exe relativeFolder libName libDir includeDir = do + mb_location <- findProgram exe Nothing + case mb_location of + Nothing -> message ("No " ++ desc ++ " (" ++ libName ++ ") library found") >> return Nothing + Just location -> do + path <- relativeFolder location + message ("Using " ++ libName ++ ": " ++ path) + makeConfig path libName libDir includeDir + + +configSqlite3 verbose = createConfigByFindingExe "Sqlite" "sqlite3" sameFolder "sqlite3" "" "" + +configOracle verbose = createConfigByFindingExe "Oracle" "sqlplus" parentFolder "oci" "bin" "oci/include" + +-- On Windows the ODBC stuff is in c:\windows\system32, which is always in the PATH. +-- So I think we only need to pass -lodbc32. +-- The include files are already in the ghc/include/mingw folder. +-- FIXME: I don't know how this should look for unixODBC. + +#ifdef mingw32_HOST_OS +configOdbc verbose = do + message ("Using odbc: <on Windows => lib already in PATH>") + return ( Just emptyBuildInfo { extraLibs = ["odbc32"] }) +#else +configOdbc verbose = createConfigByFindingExe "ODBC" "sqlplus" parentFolder "odbc" "" "" +#endif + +configPG :: Int -> IO (Maybe BuildInfo) +configPG verbose = do + mb_pq_config_path <- findProgram "pg_config" Nothing + case mb_pq_config_path of + Nothing -> message ("No PostgreSQL (pq) library found") >> return Nothing + Just pq_config_path -> do + message ("Using pq: " ++ pq_config_path) + res <- rawSystemGrabOutput verbose pq_config_path ["--libdir"] + let lib_dirs = words res + res <- rawSystemGrabOutput verbose pq_config_path ["--includedir"] + let inc_dirs = words res + res <- rawSystemGrabOutput verbose pq_config_path ["--includedir-server"] + let inc_dirs_server = words res + return ( Just emptyBuildInfo + { extraLibs = ["pq"] + , extraLibDirs = lib_dirs + , includeDirs = inc_dirs ++ inc_dirs_server + }) + +concatBuildInfo = foldr1 combineBuildInfo + +combineBuildInfo mbi Nothing = mbi +combineBuildInfo Nothing mbi = mbi +combineBuildInfo (Just bi1) (Just bi2) = + Just bi1 + { extraLibs = extraLibs bi1 ++ extraLibs bi2 + , extraLibDirs = extraLibDirs bi1 ++ extraLibDirs bi2 + , includeDirs = includeDirs bi1 ++ includeDirs bi2 + } + +rawSystemGrabOutput :: Int -> FilePath -> [String] -> IO String +rawSystemGrabOutput verbose path args = do + when (verbose > 0) . putStrLn . unwords $ path:args + tmp_dir <- getTemporaryDirectory + (outf,outh) <- openTempFile tmp_dir "out.dat" + -- process' stderr goes to our stderr + pid <- runProcess path args Nothing Nothing Nothing (Just outh) Nothing + exitCode <- waitForProcess pid + when (exitCode /= ExitSuccess) $ exitWith exitCode + file_to_contents outf + +-- properly, this time, with no lazy IO +file_to_contents fname = + bracket (openFile fname ReadMode) + (\h -> hClose h >> removeFile fname) + (reader []) + where + reader acc h = do + eof <- hIsEOF h + if eof then return . concat $ reverse acc + else do + l <- hGetLine h + reader (" ":l:acc) h
+ Setup-1162.hs view
@@ -0,0 +1,270 @@+-- #!/usr/bin/env runhaskell + +{-# OPTIONS -cpp #-} +{-# LANGUAGE CPP #-} + +-- Can't use "#!" with -cpp; get "invalid preprocessing directive #!" + +import Control.Exception (bracket) +import Control.Monad (when) +import Data.List (isPrefixOf, unionBy) +import Data.Maybe (fromJust) +import Distribution.Compiler (Compiler(..)) +import Distribution.Package ( showPackageId, PackageIdentifier(..) ) +import Distribution.PackageDescription + ( PackageDescription(..) + , BuildInfo(..), emptyBuildInfo + , HookedBuildInfo, emptyHookedBuildInfo, writeHookedBuildInfo + , Library(..), withLib, setupMessage + , haddockName, hasLibs + ) +import Distribution.PreProcess + ( preprocessSources, ppCpp', PPSuffixHandler, knownSuffixHandlers + ) +import Distribution.Program + ( programName, haddockProgram, lookupProgram, rawSystemProgram + , programArgs ) +import Distribution.Setup (ConfigFlags, configVerbose, BuildFlags + , InstallFlags(..), HaddockFlags(..), RegisterFlags(..), emptyRegisterFlags + , CopyFlags(..), CopyDest(..) + ) +import Distribution.Simple + ( defaultMainWithHooks, defaultUserHooks, UserHooks(..), Args + , hookedPreProcessors ) +import Distribution.Simple.Build (build) +import Distribution.Simple.Configure (findProgram) +import Distribution.Simple.Install (install) +import Distribution.Simple.LocalBuildInfo + ( withPrograms, LocalBuildInfo(..), buildDir, packageDeps ) +import Distribution.Simple.Register (writeInstalledConfig, register) +import Distribution.Simple.Utils (moduleToFilePath, die, haddockPref) +import Language.Haskell.Extension (Extension(..)) +import System.Directory + ( removeFile, getTemporaryDirectory, canonicalizePath + , doesFileExist, removeFile + , getPermissions, setPermissions + , doesDirectoryExist, createDirectory + , getDirectoryContents, removeDirectory + ) +import System.Exit (ExitCode(..), exitWith) +import System.FilePath + ( splitFileName, dropFileName, combine, joinPath + , splitExtension, addExtension, replaceExtension, takeDirectory ) +import System.IO(hClose, openFile, hGetLine, hIsEOF + , openTempFile, IOMode(..) ) +import System.IO.Error (try, ioError) +import System.Process(runProcess, waitForProcess) + +{- +One install script to rule them all, and in the darkness build them... + +Some of the code in this script is adapted from the various +HSQL Setup scripts, so some credit for it should go to Krasimir Angelov. +Not sure exactly what that means for our license; +does he have to appear in our license.txt? +(His code is also BSD3 licensed.) + +See this page for useful notes on tagging and releasing: + http://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program + +To-dos for Takusen: + - use hsc2hs to create #define constants from header files, + rather than hard-code them. + - Blob support (and clob?). + - ODBC back-end. + - FreeTDS back-end. + - POP3 & IMAP back-ends? + + - Unwritten tests: + * incorrect fold function (doesn't match result-set) + + +GHC compiler/linker options: + +ODBC : <none on Windows, because the .dll is in c:\windows\system32, and the headers are in ghc's include/mingw> +Postgres: -I"C:\Program Files\PostgreSQL\8.1\include" -lpq -L"C:\Program Files\PostgreSQL\8.1\bin" +Sqlite : -I"C:\Program Files\sqlite" -lsqlite3 -L"C:\Program Files\sqlite" +Oracle : -I"C:\Program Files\Oracle\OraHome817\oci\include" -loci -L"C:\Program Files\Oracle\OraHome817\bin" +Oracle : -I"%ORACLE_HOME%\oci\include" -loci -L"%ORACLE_HOME%\bin" +-} + +main = defaultMainWithHooks defaultUserHooks + { preConf=preConf, postConf=postConf + , buildHook=buildHook, instHook=installHook + } + where + preConf :: [String] -> ConfigFlags -> IO HookedBuildInfo + preConf args flags = do + try (removeFile "takusen.buildinfo") + return emptyHookedBuildInfo + postConf :: [String] -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode + postConf args flags _ localbuildinfo = do + let verbose = configVerbose flags + sqliteBI <- configSqlite3 verbose + pgBI <- configPG verbose + oraBI <- configOracle verbose + odbcBI <- configOdbc verbose + let bis = [sqliteBI, pgBI, oraBI, odbcBI] + writeHookedBuildInfo "takusen.buildinfo" (concatBuildInfo bis,[]) + return ExitSuccess + -- We patch in the buildHook so that we can modify the list of exposed + -- modules (we remove modules for back-ends that are not installed). + buildHook :: PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> BuildFlags -> IO () + buildHook pd lbi mbuh bf = defaultBuildHook (modifyPackageDesc pd) lbi mbuh bf + -- also patch the installHook + installHook :: PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> InstallFlags -> IO () + installHook pd lbi mbuh insf = defaultInstallHook (modifyPackageDesc pd) lbi mbuh insf + +--------------------------------------------------------------------- +-- Start of code copied verbatim from Distribution.Simple, +-- because it's not exported. +--getModulePaths :: BuildInfo -> [String] -> IO [FilePath] +--getModulePaths bi = +-- fmap concat . +-- mapM (flip (moduleToFilePath (hsSourceDirs bi)) ["hs", "lhs"]) + +defaultBuildHook :: PackageDescription -> LocalBuildInfo + -> Maybe UserHooks -> BuildFlags -> IO () +defaultBuildHook pkg_descr localbuildinfo hooks flags = do + build pkg_descr localbuildinfo flags (allSuffixHandlers hooks) + when (hasLibs pkg_descr) $ + writeInstalledConfig pkg_descr localbuildinfo False + +defaultInstallHook :: PackageDescription -> LocalBuildInfo + -> Maybe UserHooks ->InstallFlags -> IO () +defaultInstallHook pkg_descr localbuildinfo _ (InstallFlags uInstFlag verbose) = do + install pkg_descr localbuildinfo (CopyFlags NoCopyDest verbose) + when (hasLibs pkg_descr) $ + register pkg_descr localbuildinfo + emptyRegisterFlags{ regUser=uInstFlag, regVerbose=verbose } + +allSuffixHandlers :: Maybe UserHooks -> [PPSuffixHandler] +allSuffixHandlers hooks + = maybe knownSuffixHandlers + (\h -> overridesPP (hookedPreProcessors h) knownSuffixHandlers) + hooks + where + overridesPP :: [PPSuffixHandler] -> [PPSuffixHandler] -> [PPSuffixHandler] + overridesPP = unionBy (\x y -> fst x == fst y) +-- End of code copied verbatim from Distribution.Simple. +--------------------------------------------------------------------- + +modifyPackageDesc pd = + let + Just (Library modules buildInf) = library pd + filteredMods = filterModulesByLibs modules (extraLibs buildInf) + in pd { library = Just (Library filteredMods buildInf) } + +filterModulesByLibs modules libs = + removeModulesForAbsentLib "pq" "Database.PostgreSQL" libs + . removeModulesForAbsentLib "oci" "Database.Oracle" libs + . removeModulesForAbsentLib "sqlite3" "Database.Sqlite" libs + . filterODBCModules libs + $ modules + +removeModulesForAbsentLib lib prefix libs modules = + if not (elem lib libs) + then filter (not . isPrefixOf prefix) modules + else modules + +filterODBCModules libs modules = + if not (elem "odbc" libs || elem "odbc32" libs) + then filter (not . isPrefixOf "Database.ODBC") modules + else modules + + +sameFolder path = return (fst (splitFileName path)) +parentFolder path = canonicalizePath (fst (splitFileName path) ++ "/..") + +makeConfig path libName libDir includeDir = do + libDirs <- canonicalizePath (combine path libDir) + includeDirs <- canonicalizePath (combine path includeDir) + return (Just emptyBuildInfo + { extraLibs = [libName] + , extraLibDirs = [libDirs] + , includeDirs = [includeDirs] + } + ) + +message s = putStrLn ("configure: takusen: " ++ s) + +createConfigByFindingExe desc exe relativeFolder libName libDir includeDir = do + mb_location <- findProgram exe Nothing + case mb_location of + Nothing -> message ("No " ++ desc ++ " (" ++ libName ++ ") library found") >> return Nothing + Just location -> do + path <- relativeFolder location + message ("Using " ++ libName ++ ": " ++ path) + makeConfig path libName libDir includeDir + + +configSqlite3 verbose = createConfigByFindingExe "Sqlite" "sqlite3" sameFolder "sqlite3" "" "" + +configOracle verbose = createConfigByFindingExe "Oracle" "sqlplus" parentFolder "oci" "bin" "oci/include" + +-- On Windows the ODBC stuff is in c:\windows\system32, which is always in the PATH. +-- So I think we only need to pass -lodbc32. +-- The include files are already in the ghc/include/mingw folder. +-- FIXME: I don't know how this should look for unixODBC. + +#if mingw32_HOST_OS || mingw32_TARGET_OS +configOdbc verbose = do + message ("Using odbc: <on Windows => lib already in PATH>") + return ( Just emptyBuildInfo { extraLibs = ["odbc32"] }) +#else +configOdbc verbose = createConfigByFindingExe "ODBC" "sqlplus" parentFolder "odbc" "" "" +#endif + +configPG :: Int -> IO (Maybe BuildInfo) +configPG verbose = do + mb_pq_config_path <- findProgram "pg_config" Nothing + case mb_pq_config_path of + Nothing -> message ("No PostgreSQL (pq) library found") >> return Nothing + Just pq_config_path -> do + message ("Using pq: " ++ pq_config_path) + res <- rawSystemGrabOutput verbose pq_config_path ["--libdir"] + let lib_dirs = words res + res <- rawSystemGrabOutput verbose pq_config_path ["--includedir"] + let inc_dirs = words res + res <- rawSystemGrabOutput verbose pq_config_path ["--includedir-server"] + let inc_dirs_server = words res + return ( Just emptyBuildInfo + { extraLibs = ["pq"] + , extraLibDirs = lib_dirs + , includeDirs = inc_dirs ++ inc_dirs_server + }) + +concatBuildInfo = foldr1 combineBuildInfo + +combineBuildInfo mbi Nothing = mbi +combineBuildInfo Nothing mbi = mbi +combineBuildInfo (Just bi1) (Just bi2) = + Just bi1 + { extraLibs = extraLibs bi1 ++ extraLibs bi2 + , extraLibDirs = extraLibDirs bi1 ++ extraLibDirs bi2 + , includeDirs = includeDirs bi1 ++ includeDirs bi2 + } + +rawSystemGrabOutput :: Int -> FilePath -> [String] -> IO String +rawSystemGrabOutput verbose path args = do + when (verbose > 0) . putStrLn . unwords $ path:args + tmp_dir <- getTemporaryDirectory + (outf,outh) <- openTempFile tmp_dir "out.dat" + -- process' stderr goes to our stderr + pid <- runProcess path args Nothing Nothing Nothing (Just outh) Nothing + exitCode <- waitForProcess pid + when (exitCode /= ExitSuccess) $ exitWith exitCode + file_to_contents outf + +-- properly, this time, with no lazy IO +file_to_contents fname = + bracket (openFile fname ReadMode) + (\h -> hClose h >> removeFile fname) + (reader []) + where + reader acc h = do + eof <- hIsEOF h + if eof then return . concat $ reverse acc + else do + l <- hGetLine h + reader (" ":l:acc) h
+ Setup.hs view
@@ -0,0 +1,245 @@+-- #!/usr/bin/env runhaskell + +{-# OPTIONS -cpp #-} +{-# LANGUAGE CPP #-} + +-- Can't use "#!" with -cpp; get "invalid preprocessing directive #!" + +import Control.Exception (bracket) +import Control.Monad (when) +import Data.List (isPrefixOf, unionBy) +import Distribution.PackageDescription + ( PackageDescription(..), Library(..), BuildInfo(..), HookedBuildInfo + , emptyHookedBuildInfo, writeHookedBuildInfo, emptyBuildInfo, hasLibs + ) +import Distribution.Simple.Setup -- ( --Flag, fromFlag, toFlag + ( ConfigFlags(..), BuildFlags(..) + , InstallFlags(..), HaddockFlags(..) + , CopyFlags(..) + , RegisterFlags(..), emptyRegisterFlags + , CopyDest(..) + ) +import Distribution.Simple + ( defaultMainWithHooks, defaultUserHooks, UserHooks(..), Args ) +import Distribution.Simple.Build (build) +import Distribution.Simple.Install (install) +import Distribution.Simple.Program (findProgramOnPath) +import Distribution.Simple.LocalBuildInfo (LocalBuildInfo) +import Distribution.Simple.PreProcess (PPSuffixHandler, knownSuffixHandlers) +import Distribution.Simple.Register + (register, unregister, writeInstalledConfig,removeRegScripts) +import Distribution.Verbosity (silent, normal) +import System.Directory (getTemporaryDirectory, canonicalizePath, removeFile) +import System.Exit (ExitCode(..), exitWith) +import System.FilePath (splitFileName, combine) +import System.IO (hClose, openFile, hGetLine, hIsEOF, openTempFile, IOMode(..)) +import System.IO.Error (try, ioError) +import System.Process(runProcess, waitForProcess) + +{- +One install script to rule them all, and in the darkness build them... + +Some of the code in this script is adapted from the various +HSQL Setup scripts, so some credit for it should go to Krasimir Angelov. +Not sure exactly what that means for our license; +does he have to appear in our license.txt? +(His code is also BSD3 licensed.) + +See this page for useful notes on tagging and releasing: + http://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program + +To-dos for Takusen: + - use hsc2hs to create #define constants from header files, + rather than hard-code them. + - Blob support (and clob?). + - ODBC back-end. + - FreeTDS back-end. + - POP3 & IMAP back-ends? + + - Unwritten tests: + * incorrect fold function (doesn't match result-set) + + +GHC compiler/linker options: + +ODBC : <none on Windows, because the .dll is in c:\windows\system32, and the headers are in ghc's include/mingw> +Postgres: -I"C:\Program Files\PostgreSQL\8.1\include" -lpq -L"C:\Program Files\PostgreSQL\8.1\bin" +Sqlite : -I"C:\Program Files\sqlite" -lsqlite3 -L"C:\Program Files\sqlite" +Oracle : -I"C:\Program Files\Oracle\OraHome817\oci\include" -loci -L"C:\Program Files\Oracle\OraHome817\bin" +Oracle : -I"%ORACLE_HOME%\oci\include" -loci -L"%ORACLE_HOME%\bin" +-} + +main = defaultMainWithHooks defaultUserHooks + { preConf=preConf, postConf=postConf + , buildHook=buildHook, instHook=installHook + } + where + preConf :: Args -> ConfigFlags -> IO HookedBuildInfo + preConf args flags = do + try (removeFile "takusen.buildinfo") + return emptyHookedBuildInfo + postConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO () + postConf args flags _ localbuildinfo = do + let verbose = (configVerbose flags) + sqliteBI <- configSqlite3 verbose + pgBI <- configPG verbose + oraBI <- configOracle verbose + odbcBI <- configOdbc verbose + let bis = [sqliteBI, pgBI, oraBI, odbcBI] + writeHookedBuildInfo "takusen.buildinfo" (concatBuildInfo bis,[]) + -- We patch in the buildHook so that we can modify the list of exposed + -- modules (we remove modules for back-ends that are not installed). + buildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO () + buildHook pd lbi uh bf = defaultBuildHook (modifyPackageDesc pd) lbi uh bf + -- also patch the installHook + installHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO () + installHook pd lbi uh insf = defaultInstallHook (modifyPackageDesc pd) lbi uh insf + +-- BEGIN: Copied verbatim from Distribution.Simple (in Cabal-1.2.2.0) +defaultInstallHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +defaultInstallHook pkg_descr localbuildinfo _ (InstallFlags uInstFlag verbosity) = do + install pkg_descr localbuildinfo (CopyFlags NoCopyDest verbosity) + when (hasLibs pkg_descr) $ + register pkg_descr localbuildinfo + emptyRegisterFlags{ regPackageDB=uInstFlag, regVerbose=verbosity } + +defaultBuildHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> BuildFlags -> IO () +defaultBuildHook pkg_descr localbuildinfo hooks flags = do + build pkg_descr localbuildinfo flags (allSuffixHandlers hooks) + when (hasLibs pkg_descr) $ + writeInstalledConfig pkg_descr localbuildinfo False Nothing + +allSuffixHandlers :: UserHooks + -> [PPSuffixHandler] +allSuffixHandlers hooks + = overridesPP (hookedPreProcessors hooks) knownSuffixHandlers + where + overridesPP :: [PPSuffixHandler] -> [PPSuffixHandler] -> [PPSuffixHandler] + overridesPP = unionBy (\x y -> fst x == fst y) + +-- END: Copied verbatim from Distribution.Simple + + +modifyPackageDesc pd = + let + Just (Library modules buildInf) = library pd + filteredMods = filterModulesByLibs modules (extraLibs buildInf) + in pd { library = Just (Library filteredMods buildInf) } + +filterModulesByLibs modules libs = + removeModulesForAbsentLib "pq" "Database.PostgreSQL" libs + . removeModulesForAbsentLib "oci" "Database.Oracle" libs + . removeModulesForAbsentLib "sqlite3" "Database.Sqlite" libs + . filterODBCModules libs + $ modules + +removeModulesForAbsentLib lib prefix libs modules = + if not (elem lib libs) + then filter (not . isPrefixOf prefix) modules + else modules + +filterODBCModules libs modules = + if not (elem "odbc" libs || elem "odbc32" libs) + then filter (not . isPrefixOf "Database.ODBC") modules + else modules + + +sameFolder path = return (fst (splitFileName path)) +parentFolder path = canonicalizePath (fst (splitFileName path) ++ "/..") + +makeConfig path libName libDir includeDir = do + libDirs <- canonicalizePath (combine path libDir) + includeDirs <- canonicalizePath (combine path includeDir) + return (Just emptyBuildInfo + { extraLibs = [libName] + , extraLibDirs = [libDirs] + , includeDirs = [includeDirs] + } + ) + +message s = putStrLn ("configure: takusen: " ++ s) + +findProgram exe _ = findProgramOnPath exe normal + +createConfigByFindingExe desc exe relativeFolder libName libDir includeDir = do + mb_location <- findProgram exe Nothing + case mb_location of + Nothing -> message ("No " ++ desc ++ " (" ++ libName ++ ") library found") >> return Nothing + Just location -> do + path <- relativeFolder location + message ("Using " ++ libName ++ ": " ++ path) + makeConfig path libName libDir includeDir + + +configSqlite3 verbose = createConfigByFindingExe "Sqlite" "sqlite3" sameFolder "sqlite3" "" "" + +configOracle verbose = createConfigByFindingExe "Oracle" "sqlplus" parentFolder "oci" "bin" "oci/include" + +-- On Windows the ODBC stuff is in c:\windows\system32, which is always in the PATH. +-- So I think we only need to pass -lodbc32. +-- The include files are already in the ghc/include/mingw folder. +-- FIXME: I don't know how this should look for unixODBC. + +#if mingw32_HOST_OS || mingw32_TARGET_OS +configOdbc verbose = do + message ("Using odbc: <on Windows => lib already in PATH>") + return ( Just emptyBuildInfo { extraLibs = ["odbc32"] }) +#else +configOdbc verbose = createConfigByFindingExe "ODBC" "sqlplus" parentFolder "odbc" "" "" +#endif + +--configPG :: Int -> IO (Maybe BuildInfo) +configPG verbose = do + mb_pq_config_path <- findProgram "pg_config" Nothing + case mb_pq_config_path of + Nothing -> message ("No PostgreSQL (pq) library found") >> return Nothing + Just pq_config_path -> do + message ("Using pq: " ++ pq_config_path) + res <- rawSystemGrabOutput verbose pq_config_path ["--libdir"] + let lib_dirs = words res + res <- rawSystemGrabOutput verbose pq_config_path ["--includedir"] + let inc_dirs = words res + res <- rawSystemGrabOutput verbose pq_config_path ["--includedir-server"] + let inc_dirs_server = words res + return ( Just emptyBuildInfo + { extraLibs = ["pq"] + , extraLibDirs = lib_dirs + , includeDirs = inc_dirs ++ inc_dirs_server + }) + +concatBuildInfo = foldr1 combineBuildInfo + +combineBuildInfo mbi Nothing = mbi +combineBuildInfo Nothing mbi = mbi +combineBuildInfo (Just bi1) (Just bi2) = + Just bi1 + { extraLibs = extraLibs bi1 ++ extraLibs bi2 + , extraLibDirs = extraLibDirs bi1 ++ extraLibDirs bi2 + , includeDirs = includeDirs bi1 ++ includeDirs bi2 + } + +--rawSystemGrabOutput :: Int -> FilePath -> [String] -> IO String +rawSystemGrabOutput verbose path args = do + when (verbose > normal) . putStrLn . unwords $ path:args + tmp_dir <- getTemporaryDirectory + (outf,outh) <- openTempFile tmp_dir "out.dat" + -- process' stderr goes to our stderr + pid <- runProcess path args Nothing Nothing Nothing (Just outh) Nothing + exitCode <- waitForProcess pid + when (exitCode /= ExitSuccess) $ exitWith exitCode + file_to_contents outf + +-- properly, this time, with no lazy IO +file_to_contents fname = + bracket (openFile fname ReadMode) + (\h -> hClose h >> removeFile fname) + (reader []) + where + reader acc h = do + eof <- hIsEOF h + if eof then return . concat $ reverse acc + else do + l <- hGetLine h + reader (" ":l:acc) h
+ Takusen.cabal view
@@ -0,0 +1,62 @@+Name: Takusen +Version: 0.7 +License: BSD3 +License-file: LICENSE +Author: Alistair Bayley, Oleg Kiselyov +Copyright: 2003-2007, Alistair Bayley, Oleg Kiselyov +Maintainer: alistair@abayley.org, oleg@pobox.com +Stability: experimental +Homepage: http://darcs.haskell.org/takusen +Package-url: http://darcs.haskell.org/takusen +Category: Database +Build-Depends: base, mtl, time, old-time +Build-type: Simple +Synopsis: Database library with left-fold interface, for PostgreSQL, Oracle, SQLite, ODBC. +Description: + Takusen is a DBMS access library. It has a backend for Oracle on Unix, + Linux or Windows via OCI, and a stub to test the library without any database. + The infrastructure and the stub let one interface natively with other + databases. + + The distinguished feature of Takusen is processing query results using a + left-fold enumerator. The user supplies an iteratee function, which receives + rows one-at-a-time from the result-set. The number of the arguments to the + iteratee is the number of the columns in the result-set, plus the seed. Each + column in the result-set has its own Haskell type. The latter could be a Maybe + type if the particular iteratee wishes to process NULLs. + + The benefits are: more convenient and intuitive enumeration, iteration, and + accumulation (see tests for examples); the retrieved data are not merely + strings but have Haskell types: Int, Float, Date, etc.; buffer preallocation; + pre-fetching; support for both enumerators and cursors, proper handling of all + errors including various IO errors. No unsafe operations are used. +Exposed-modules: + Database.Enumerator + , Database.Util + , Database.ODBC.Enumerator + , Database.ODBC.OdbcFunctions + , Database.Oracle.Enumerator + , Database.Oracle.OCIConstants + , Database.Oracle.OCIFunctions + , Database.PostgreSQL.Enumerator + , Database.PostgreSQL.PGFunctions + , Database.Sqlite.Enumerator + , Database.Sqlite.SqliteFunctions + , Database.Stub.Enumerator + , Control.Exception.MonadIO + , Foreign.C.UTF8 +Other-modules: + Database.InternalEnumerator + -- We don't expose the Test modules; the only reason to do so would be so Haddock + -- can use them (to stop the warnings "could not find link destination for:"), + -- and for that they'd have to be in Exposed-modules. + -- Modules in Other-modules are passed to Haddock with --hide=<module-name>. +Ghc-Prof-Options: -prof -auto-all + --Ghc-Options: -O2 + --Ghc-Options: -optl-Wl--enable-stdcall-fixup +Extensions: CPP +Extra-tmp-files: + Database/Oracle/OCIFunctions_stub.c + Database/Oracle/OCIFunctions_stub.h + Database/PostgreSQL/PGFunctions_stub.c + Database/PostgreSQL/PGFunctions_stub.h
+ Test/MiniUnit.hs view
@@ -0,0 +1,176 @@+ +-- | +-- Module : Database.Enumerator +-- Copyright : (c) 2004 Oleg Kiselyov, Alistair Bayley +-- License : BSD-style +-- Maintainer : oleg@pobox.com, alistair@abayley.org +-- Stability : experimental +-- Portability : portable +-- +-- This is just a simple one-module unit test framework, with the same +-- API as "Test.HUnit" (albeit with a lot of stuff missing). +-- We use it because it works in 'Control.Exception.MonadIO.CaughtMonadIO' +-- instead of IO +-- (and also because I couldn't convert "Test.HUnit" +-- to use 'Control.Exception.MonadIO.CaughtMonadIO'). + + +module Test.MiniUnit + ( + -- ** Primary API + runTestTT, assertFailure, assertBool, assertString, assertEqual + -- ** Exposed for self-testing only; see "Test.MiniUnitTest" + , TestResult(..), throwUserError, runSingleTest, reportResults + ) +where + +import Control.Exception.MonadIO +import Control.Exception +import Control.Monad +import Control.Monad.Trans (liftIO) +import System.IO.Error (ioeGetErrorString) +import System.IO +import Data.List +import Data.IORef + + +data TestResult = TestSuccess | TestFailure String | TestException String + deriving (Show, Eq) + +-- We'll use HUnit's trick of throwing an IOError when an assertion fails. +-- This will terminate the test case, obviously, but we catch the exception +-- and record that it haa failed so that we can continue with other +-- test cases. + +-- Unlike HUnit, we catch all exceptions; any that are not thrown by +-- failed assertions are recorded as test errors (as opposed to test failures), +-- and the testing continues... + +throwUserError :: CaughtMonadIO m => String -> m () +throwUserError msg = liftIO (throwIO (IOException (userError msg))) + +-- When an assertion fails, we throw an IOException with a special +-- text prefix, which the exception handler will detect. +assertFailure :: CaughtMonadIO m => String -> m () +assertFailure msg = throwUserError (exceptionPrefix ++ msg) + +exceptionPrefix = "MiniUnit:" +hugsPrefix = "IO Error: User error\nReason: " +nhc98Prefix = "I/O error (user-defined), call to function `userError':\n " +ghcPrefix = "" -- We don't use this; it's just documentation... + +dropPrefix p s = if isPrefixOf p s then drop (length p) s else s +trimCompilerPrefixes = dropPrefix hugsPrefix . dropPrefix nhc98Prefix + +runSingleTest :: CaughtMonadIO m => m () -> m TestResult +runSingleTest action = do + result <- gtry action + case result of + Right _ -> return TestSuccess + Left e -> do + case ioErrors e of + Nothing -> return (TestException (show e)) + Just ioe -> do + let errText = trimCompilerPrefixes (ioeGetErrorString ioe) + if isPrefixOf exceptionPrefix errText + then return (TestFailure (dropPrefix exceptionPrefix errText)) + else return (TestException (show e)) + +-- Predicates for list filtering +isSuccess TestSuccess = True +isSuccess _ = False +isFailure (TestFailure _) = True +isFailure _ = False +isError (TestException _) = True +isError _ = False + +-- Make function composition look more like Unix pipes. +-- This first definition requires a Point-Free Style. +-- I prefer the PFS, as you can use it in (for example) predicate +-- functions passed as arguments (see filter example below). +infixl 9 |> +(|>) = flip (.) + +-- This second definition affords a more pointed style... +-- We can use this operator to inject an argument into a pipe +-- defined using |>; it has lower precedence, so will bind last. +-- e.g. ... = mylist |>> zip [1..] |> filter (snd |> pred) |> map show |> concat +infixl 8 |>> +(|>>) = flip ($) + +--reportFilter pred = zip [1..] |> filter (snd |> pred) |> map testReporter |> concat + +testReporter (n, TestSuccess) = "" +testReporter (n, TestException s) = "Test " ++ show n ++ " failed with exception:\n" ++ s ++ "\n" +testReporter (n, TestFailure s) = "Test " ++ show n ++ " failed with message:\n" ++ s ++ "\n" + +reportResults list = + let + s = list |>> filter isSuccess |> length + e = list |>> filter isError |> length + f = list |>> filter isFailure |> length + in "Test cases: " ++ show (length list) + ++ " Failures: " ++ show f + ++ " Errors: " ++ show e + -- ++ reportFilter isFailure list + -- ++ reportFilter isError list + +-- 2 defns for same result; which is better? +--contains pred = filter pred |> null |> not +contains p l = maybe False (const True) (find p l) + +-- | Return 0 if everything is rosy, +-- 1 if there were assertion failures (but no exceptions), +-- 2 if there were any exceptions. +-- You could use this return code as the return code from +-- your program, if you're driving from the command line. +runTestTT :: CaughtMonadIO m => String -> [m ()] -> m Int +runTestTT desc list = do + liftIO (putStrLn "") + when (desc /= "") (liftIO (putStr (desc ++ " - "))) + liftIO (putStrLn ("Test case count: " ++ show (length list))) + r <- mapM (\(n, t) -> liftIO (putStr "." >> hFlush stdout) >> runSingleTestTT n t) (zip [1..] list) + liftIO (putStrLn "") + liftIO (putStrLn (reportResults r)) + if contains isError r + then return 2 + else if contains isFailure r + then return 1 + else return 0 + +-- Could use this instead of runSingleTest - it will output +-- failures and exceptions as they occur, rather than all +-- at the end. +runSingleTestTT :: CaughtMonadIO m => Int -> m () -> m TestResult +runSingleTestTT n test = do + r <- runSingleTest test + case r of + TestSuccess -> return r + TestFailure _ -> liftIO (putStrLn ('\n':(testReporter (n ,r)))) >> return r + TestException _ -> liftIO (putStrLn ('\n':(testReporter (n, r)))) >> return r + +--------------------------------------------- +-- That's the basic framework; now for some sugar... +-- ... stolen straight from Dean Herrington's HUnit code. +-- Shall we steal his infix operators, too? + +assertBool :: CaughtMonadIO m => String -> Bool -> m () +assertBool msg b = unless b (assertFailure msg) + +assertString :: CaughtMonadIO m => String -> m () +assertString s = unless (null s) (assertFailure s) + +assertEqual :: (Eq a, Show a, CaughtMonadIO m) => + String -- ^ message preface + -> a -- ^ expected + -> a -- ^ actual + -> m () +assertEqual preface expected actual = do + let + msg = + (if null preface then "" else preface ++ "\n") + ++ "expect: " ++ show expected ++ "\nactual: " ++ show actual + unless (actual == expected) (assertFailure msg) + + +--p @? msg = assertBool msg p
+ Test/MiniUnitTest.hs view
@@ -0,0 +1,62 @@+ +{-# OPTIONS -fno-monomorphism-restriction #-} + +module Test.MiniUnitTest where + +import Test.MiniUnit +import Data.IORef +import Control.Exception.MonadIO +import Control.Monad.Trans (liftIO) + +main :: IO () +main = tests + + + +tests = do + test__assertFailure + test__runSingleTestSuccess + test__runSingleTestFailure + test__runSingleTestException + test__reportResults + test__runTestTT + +print_ s = liftIO (putStrLn s) + +test__assertFailure = catch + (assertFailure "test__assertFailure" + >> error "test__assertFailure: Exception not thrown") + (\e -> print_ "test__assertFailure OK") + +test__runSingleTestSuccess = do + result <- runSingleTest (return ()) + case result of + TestSuccess -> print_ "test__runSingleTestSuccess OK" + TestFailure _ -> print_ "test__runSingleTestSuccess failed" + TestException _ -> print_ "test__runSingleTest exception" + +test__runSingleTestFailure = do + result <- runSingleTest (assertFailure "test__runSingleTestFailure") + case result of + TestSuccess -> print_ "test__runSingleTestFailure failed" + TestFailure _ -> print_ "test__runSingleTestFailure OK" + TestException _ -> print_ "test__runSingleTestFailure exception" + +test__runSingleTestException = do + result <- runSingleTest (throwUserError "boo") + case result of + TestSuccess -> print_ "test__runSingleTestException failed" + TestFailure _ -> print_ "test__runSingleTestException failed!" + TestException _ -> print_ "test__runSingleTestException OK" + +test__reportResults = do + results <- mapM runSingleTest + [assertFailure "test__runSingleTest", return (), throwUserError "boo"] + print_ ("report results: " ++ reportResults results) + + +test__runTestTT = do + r <- runTestTT "MiniUnitTest" [assertFailure "test__runSingleTest", return (), throwUserError "boo"] + return () + +----
+ doc/html/Control-Exception-MonadIO.html view
@@ -0,0 +1,251 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Control.Exception.MonadIO</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Control.Exception.MonadIO</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO" +>MonadIO</A +> m => <A NAME="t%3ACaughtMonadIO" +></A +><B +>CaughtMonadIO</B +> m <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3Agcatch" +></A +><B +>gcatch</B +> :: m a -> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#t%3AException" +>Exception</A +> -> m a) -> m a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgcatchJust" +></A +><B +>gcatchJust</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#t%3AException" +>Exception</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b) -> m a -> (b -> m a) -> m a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:CaughtMonadIO')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:CaughtMonadIO" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> si => <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark si)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Reader.html#t%3AReaderT" +>ReaderT</A +> a m)</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Agtry" +></A +><B +>gtry</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => m b -> m (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Either.html#t%3AEither" +>Either</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#t%3AException" +>Exception</A +> b)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgtryJust" +></A +><B +>gtryJust</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#t%3AException" +>Exception</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b) -> m b1 -> m (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Either.html#t%3AEither" +>Either</A +> b b1)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Agbracket" +></A +><B +>gbracket</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => m t -> (t -> m a) -> (t -> m b) -> m b</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Agfinally" +></A +><B +>gfinally</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => m t -> m a -> m t</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Enumerator.html view
@@ -0,0 +1,3664 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="#1" +>Usage +</A +></DT +><DD +><DL +><DT +><A HREF="#2" +>Iteratee Functions +</A +></DT +><DT +><A HREF="#3" +>result and result' +</A +></DT +><DT +><A HREF="#4" +>Rank-2 types, ($), and the monomorphism restriction +</A +></DT +><DT +><A HREF="#5" +>Bind Parameters +</A +></DT +><DT +><A HREF="#6" +>Multiple (and nested) Result Sets +</A +></DT +></DL +></DD +><DT +><A HREF="#7" +>Sessions and Transactions +</A +></DT +><DT +><A HREF="#8" +>Exceptions and handlers +</A +></DT +><DT +><A HREF="#9" +>Preparing and Binding +</A +></DT +><DT +><A HREF="#10" +>Iteratees and Cursors +</A +></DT +><DT +><A HREF="#11" +>Utilities +</A +></DT +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>Abstract database interface, providing a left-fold enumerator + and cursor operations. +</P +><P +>There is a stub: <A HREF="Database-Stub-Enumerator.html" +>Database.Stub.Enumerator</A +>. + This lets you run the test cases without having a working DBMS installation. + This isn't so valuable now, because it's dead easy to install Sqlite, + but it's still there if you want to try it. +</P +><P +>Additional reading: +</P +><UL +><LI +> <A HREF="http://pobox.com/~oleg/ftp/Haskell/misc.html#fold-stream" +>http://pobox.com/~oleg/ftp/Haskell/misc.html#fold-stream</A +> +</LI +><LI +> <A HREF="http://pobox.com/~oleg/ftp/papers/LL3-collections-enumerators.txt" +>http://pobox.com/~oleg/ftp/papers/LL3-collections-enumerators.txt</A +> +</LI +><LI +> <A HREF="http://www.eros-os.org/pipermail/e-lang/2004-March/009643.html" +>http://www.eros-os.org/pipermail/e-lang/2004-March/009643.html</A +> +</LI +></UL +><P +>Note that there are a few functions that are exported from each DBMS-specific + implementation which are exposed to the API user, and which are part of + the Takusen API, but are not (necessarily) in this module. + They include: +</P +><UL +><LI +> <TT +>connect</TT +> (obviously DBMS specific) +</LI +><LI +><PRE +>prepareQuery, prepareLargeQuery, prepareCommand, sql, sqlbind, prefetch, cmdbind</PRE +></LI +></UL +><P +>These functions will typically have the same names and intentions, + but their specific types and usage may differ between DBMS. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ADBM" +>DBM</A +> mark sess a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithSession" +>withSession</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess) => <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> sess -> (<SPAN CLASS="keyword" +>forall</SPAN +> mark . <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithContinuedSession" +>withContinuedSession</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess) => <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> sess -> (<SPAN CLASS="keyword" +>forall</SPAN +> mark . <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (a, <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> sess)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Acommit" +>commit</A +> :: <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> s => <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Arollback" +>rollback</A +> :: <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> s => <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbeginTransaction" +>beginTransaction</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Reader.html#t%3AMonadReader" +>MonadReader</A +> s (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Reader.html#t%3AReaderT" +>ReaderT</A +> s <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +>), <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> s) => <A HREF="Database-Enumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +> -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithTransaction" +>withTransaction</A +> :: <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> s => <A HREF="Database-Enumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +> -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AIsolationLevel" +>IsolationLevel</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3AReadUncommitted" +>ReadUncommitted</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3AReadCommitted" +>ReadCommitted</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ARepeatableRead" +>RepeatableRead</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ASerialisable" +>Serialisable</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ASerializable" +>Serializable</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AexecDDL" +>execDDL</A +> :: <A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> stmt s => stmt -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AexecDML" +>execDML</A +> :: <A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> stmt s => stmt -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ADBException" +>DBException</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ADBError" +>DBError</A +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBFatal" +>DBFatal</A +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBUnexpectedNull" +>DBUnexpectedNull</A +> <A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +> <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBNoData" +>DBNoData</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbasicDBExceptionReporter" +>basicDBExceptionReporter</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreportRethrow" +>reportRethrow</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AformatDBException" +>formatDBException</A +> :: <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcatchDB" +>catchDB</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => m a -> (<A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> m a) -> m a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcatchDBError" +>catchDBError</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> m a -> (<A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> m a) -> m a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AignoreDBError" +>ignoreDBError</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> m a -> m a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowDB" +>throwDB</A +> :: <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3APreparedStmt" +>PreparedStmt</A +> mark stmt = <A HREF="#v%3APreparedStmt" +>PreparedStmt</A +> stmt</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithPreparedStatement" +>withPreparedStatement</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> stmt sess bstmt bo) => <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> sess stmt -> (<A HREF="Database-Enumerator.html#t%3APreparedStmt" +>PreparedStmt</A +> mark stmt -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a) -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithBoundStatement" +>withBoundStatement</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> stmt s bstmt bo) => <A HREF="Database-Enumerator.html#t%3APreparedStmt" +>PreparedStmt</A +> mark stmt -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> s stmt bo] -> (bstmt -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a) -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindP" +>bindP</A +> :: <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a sess stmt bo => a -> <A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdoQuery" +>doQuery</A +> :: (<A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> stmt sess q, QueryIteratee (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess) q i seed b, <A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> q sess b) => stmt -> i -> seed -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess seed</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AIterResult" +>IterResult</A +> seedType = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Either.html#t%3AEither" +>Either</A +> seedType seedType</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AIterAct" +>IterAct</A +> m seedType = seedType -> m (<A HREF="Database-Enumerator.html#t%3AIterResult" +>IterResult</A +> seedType)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcurrentRowNum" +>currentRowNum</A +> :: <A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> q sess b => q -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ANextResultSet" +>NextResultSet</A +> mark stmt = <A HREF="#v%3ANextResultSet" +>NextResultSet</A +> (<A HREF="Database-Enumerator.html#t%3APreparedStmt" +>PreparedStmt</A +> mark stmt)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ARefCursor" +>RefCursor</A +> a = <A HREF="#v%3ARefCursor" +>RefCursor</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcursorIsEOF" +>cursorIsEOF</A +> :: DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s) a -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcursorCurrent" +>cursorCurrent</A +> :: DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s) a -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcursorNext" +>cursorNext</A +> :: DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s) a -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s (DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s) a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithCursor" +>withCursor</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> stmt sess q, QueryIteratee (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess) q i seed b, <A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> q sess b) => stmt -> i -> seed -> (DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess) seed -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a) -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AifNull" +>ifNull</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> a -> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aresult" +>result</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aresult%27" +>result'</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="1" +>Usage +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>Let's look at some example code: +</P +><PRE +> -- sample code, doesn't necessarily compile + module MyDbExample is + + import Database.Oracle.Enumerator + import Database.Enumerator + ... + + query1Iteratee :: (Monad m) => Int -> String -> Double -> IterAct m [(Int, String, Double)] + query1Iteratee a b c accum = result' ((a, b, c):accum) + + -- non-query actions. + otherActions session = do + execDDL (sql "create table blah") + execDML (sql "insert into blah ...") + commit + -- Use withTransaction to delimit a transaction. + -- It will commit at the end, or rollback if an error occurs. + withTransaction Serialisable ( do + execDML (sql "update blah ...") + execDML (sql "insert into blah ...") + ) + + main :: IO () + main = do + withSession (connect "user" "password" "server") ( do + -- simple query, returning reversed list of rows. + r <- doQuery (sql "select a, b, c from x") query1Iteratee [] + liftIO $ putStrLn $ show r + otherActions session + ) +</PRE +><P +>Notes: +</P +><UL +><LI +> connection is made by <TT +><A HREF="Database-Enumerator.html#v%3AwithSession" +>withSession</A +></TT +>, + which also disconnects when done i.e. <TT +><A HREF="Database-Enumerator.html#v%3AwithSession" +>withSession</A +></TT +> + delimits the connection. + You must pass it a connection action, which is back-end specific, + and created by calling the <TT +><A HREF="Database-Sqlite-Enumerator.html#v%3Aconnect" +>connect</A +></TT +> + function from the relevant back-end. +</LI +><LI +> inside the session, the usual transaction delimiter commands are usable + e.g. <TT +><A HREF="Database-Enumerator.html#v%3AbeginTransaction" +>beginTransaction</A +></TT +> <TT +><A HREF="Database-Enumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +></TT +>, + <TT +><A HREF="Database-Enumerator.html#v%3Acommit" +>commit</A +></TT +>, <TT +><A HREF="Database-Enumerator.html#v%3Arollback" +>rollback</A +></TT +>, and + <TT +><A HREF="Database-Enumerator.html#v%3AwithTransaction" +>withTransaction</A +></TT +>. + We also provide <TT +><A HREF="Database-Enumerator.html#v%3AexecDML" +>execDML</A +></TT +> and <TT +><A HREF="Database-Enumerator.html#v%3AexecDDL" +>execDDL</A +></TT +>. +</LI +><LI +> non-DML and -DDL commands - i.e. queries - are processed by + <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> (this is the API for our left-fold). + See more explanation and examples below in <EM +>Iteratee Functions</EM +> and + <EM +>Bind Parameters</EM +> sections. +</LI +></UL +><P +>The first argument to <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> must be an instance of + <TT +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +></TT +>. + Each back-end will provide a useful set of <TT +>Statement</TT +> instances + and associated constructor functions for them. + For example, currently all back-ends have: +</P +><UL +><LI +> for basic, all-text statements (no bind variables, default row-caching) + which can be used as queries or commands: +</LI +></UL +><PRE +> sql "select ..." +</PRE +><UL +><LI +> for a select with bind variables: +</LI +></UL +><PRE +> sqlbind "select ..." [bindP ..., bindP ...] +</PRE +><UL +><LI +> for a select with bind variables and row caching: +</LI +></UL +><PRE +> prefetch 100 "select ..." [bindP ..., bindP ...] +</PRE +><UL +><LI +> for a DML command with bind variables: +</LI +></UL +><PRE +> cmdbind "insert into ..." [bindP ..., bindP ...] +</PRE +><UL +><LI +> for a reusable prepared statement: we have to first create the + prepared statement, and then bind in a separate step. + This separation lets us re-use prepared statements: +</LI +></UL +><PRE +> let stmt = prepareQuery (sql "select ...") + withPreparedStatement stmt $ \pstmt -> + withBoundStatement pstmt [bindP ..., bindP ...] $ \bstmt -> do + result <- doQuery bstmt iter seed + ... +</PRE +><P +>The PostgreSQL backend additionally requires that when preparing statements, + you (1) give a name to the prepared statement, + and (2) specify types for the bind parameters. + The list of bind-types is created by applying the + <TT +><A HREF="Database-PostgrSQL-Enumerator.html#v%3AbindType" +>bindType</A +></TT +> function + to dummy values of the appropriate types. e.g. +</P +><PRE +> let stmt = prepareQuery "stmtname" (sql "select ...") [bindType "", bindType (0::Int)] + withPreparedStatement stmt $ \pstmt -> ... +</PRE +><P +>A longer explanation of prepared statements and + bind variables is in the Bind Parameters section below. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="2" +>Iteratee Functions +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +><TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> takes an iteratee function, of n arguments. + Argument n is the accumulator (or seed). + For each row that is returned by the query, + the iteratee function is called with the data from that row in + arguments 1 to n-1, and the current accumulated value in the argument n. +</P +><P +>The iteratee function returns the next value of the accumulator, + wrapped in an <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Either.html#t%3AEither" +>Either</A +></TT +>. + If the <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Either.html#t%3AEither" +>Either</A +></TT +> value is <TT +>Left</TT +>, then the query will terminate, + returning the wrapped accumulator/seed value. + If the value is <TT +>Right</TT +>, then the query will continue, with the next row + begin fed to the iteratee function, along with the new accumulator/seed value. +</P +><P +>In the example above, <TT +>query1Iteratee</TT +> simply conses the new row (as a tuple) + to the front of the accumulator. + The initial seed passed to <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> was an empty list. + Consing the rows to the front of the list results in a list + with the rows in reverse order. +</P +><P +>The types of values that can be used as arguments to the iteratee function + are back-end specific; they must be instances of the class + <TT +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +></TT +>. + Most backends directly support the usual lowest-common-denominator set + supported by most DBMS's: <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TT +>, <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TT +>, + <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +></TT +>, <TT +><A HREF="Data-Time.html#t%3AUTCTime" +>UTCTime</A +></TT +>. + (<TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TT +> is often, but not always, supported.) +</P +><P +>By directly support we mean there is type-specific marshalling code + implemented. + Indirect support for <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Read.html#t%3ARead" +>Read</A +></TT +>- and <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +></TT +>-able types + is supported by marshalling to and from <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TT +>s. + This is done automatically by the back-end; + there is no need for user-code to perform the marshalling, + as long as instances of <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Read.html#t%3ARead" +>Read</A +></TT +> and <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +></TT +> are defined. +</P +><P +>The iteratee function operates in the <TT +><A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +></TT +> monad, + so if you want to do IO in it you must use <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Trans.html#v%3AliftIO" +>liftIO</A +></TT +> + (e.g. <TT +>liftIO $ putStrLn "boo"</TT +> ) to lift the IO action into <TT +><A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +></TT +>. +</P +><P +>The iteratee function is not restricted to just constructing lists. + For example, a simple counter function would ignore its arguments, + and the accumulator would simply be the count e.g. +</P +><PRE +> counterIteratee :: (Monad m) => Int -> IterAct m Int + counterIteratee _ i = result' $ (1 + i) +</PRE +><P +>The iteratee function that you pass to <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> + needs type information, + at least for the arguments if not the return type (which is typically + determined by the type of the seed). + The type synonyms <TT +><A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +></TT +> and <TT +><A HREF="Database-Enumerator.html#t%3AIterResult" +>IterResult</A +></TT +> give some convenience + in writing type signatures for iteratee functions: +</P +><PRE +> type IterResult seedType = Either seedType seedType + type IterAct m seedType = seedType -> m (IterResult seedType) +</PRE +><P +>Without them, the type for <TT +>counterIteratee</TT +> would be: +</P +><PRE +> counterIteratee :: (Monad m) => Int -> Int -> m (Either Int Int) +</PRE +><P +>which doesn't seem so onerous, but for more elaborate seed types + (think large tuples) it certainly helps e.g. +</P +><PRE +> iter :: Monad m => + String -> Double -> CalendarTime -> [(String, Double, CalendarTime)] + -> m (Either [(String, Double, CalendarTime)] [(String, Double, CalendarTime)] ) +</PRE +><P +>reduces to (by using <TT +><A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +></TT +> and <TT +><A HREF="Database-Enumerator.html#t%3AIterResult" +>IterResult</A +></TT +>): +</P +><PRE +> iter :: Monad m => + String -> Double -> CalendarTime -> IterAct m [(String, Double, CalendarTime)] +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="3" +>result and result' +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>The <TT +><A HREF="Database-Enumerator.html#v%3Aresult" +>result</A +></TT +> (lazy) and <TT +>result'</TT +> (strict) functions are another convenient shorthand + for returning values from iteratee functions. The return type from an iteratee is actually + <TT +>Either seed seed</TT +>, where you return <TT +>Right</TT +> if you want processing to continue, + or <TT +>Left</TT +> if you want processing to stop before the result-set is exhausted. + The common case is: +</P +><PRE +> query1Iteratee a b c accum = return (Right ((a, b, c):accum)) +</PRE +><P +>which we can write as +</P +><PRE +> query1Iteratee a b c accum = result $ (a, b, c):accum) +</PRE +><P +>We have lazy and strict versions of <TT +>result</TT +>. The strict version is almost certainly + the one you want to use. If you come across a case where the lazy function is useful, + please tell us about it. The lazy function tends to exhaust the stack for large result-sets, + whereas the strict function does not. + This is due to the accumulation of a large number of unevaluated thunks, + and will happen even for simple arithmetic operations such as counting or summing. +</P +><P +>If you use the lazy function and you have stack/memory problems, do some profiling. + With GHC: +</P +><UL +><LI +> ensure the iteratee has its own cost-centre (make it a top-level function) +</LI +><LI +> compile with <TT +>-prof -auto-all</TT +> +</LI +><LI +> run with <TT +>+RTS -p -hr -RTS</TT +> +</LI +><LI +> run <TT +>hp2ps</TT +> over the resulting <TT +>.hp</TT +> file to get a <TT +>.ps</TT +> document, and take a look at it. + Retainer sets are listed on the RHS, and are prefixed with numbers e.g. (13)CAF, (2)SYSTEM. + At the bottom of the <TT +>.prof</TT +> file you'll find the full descriptions of the retainer sets. + Match the number in parentheses on the <TT +>.ps</TT +> graph with a SET in the <TT +>.prof</TT +> file; + the one at the top of the <TT +>.ps</TT +> graph is the one using the most memory. +</LI +></UL +><P +>You'll probably find that the lazy iteratee is consuming all of the stack with lazy thunks, + which is why we recommend the strict function. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="4" +>Rank-2 types, ($), and the monomorphism restriction +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>In some examples we use the application operator ($) instead of parentheses + (some might argue that this is a sign of developer laziness). + At first glance, ($) and conventional function application via juxtaposition + seem to be interchangeable e.g. +</P +><PRE +> liftIO (putStrLn (show x)) +</PRE +><P +>looks equivalent to +</P +><PRE +> liftIO $ putStrLn $ show x +</PRE +><P +>But they're not, because Haskell's type system gives us a nice compromise. +</P +><P +>In a Hindley-Milner type system (like ML) there is no difference between + ($) and function application, because polymorphic functions are not + first-class and cannot be passed to other functions. + At the other end of the scale, ($) and function application in System F + are equivalent, because polymorphic functions can be passed to other + functions. However, type inference in System F is undecidable. +</P +><P +>Haskell hits the sweet spot: maintaining full inference, + and permitting rank-2 polymorphism, in exchange for very few + type annotations. Only functions that take polymorphic functions (and + thus are higher-rank) need type signatures. Rank-2 types can't be + inferred. The function ($) is a regular, rank-1 function, and so + it can't take polymorphic functions as arguments and return + polymorphic functions. +</P +><P +>Here's an example where ($) fails: + we supply a simple test program in the README file. + If you change the <TT +>withSession</TT +> line to use ($), like so + (and remove the matching end-parenthese): +</P +><PRE +> withSession (connect "sqlite_db") $ do +</PRE +><P +>then you get the error: +</P +><PRE +> Main.hs:7:38: + Couldn't match expected type `forall mark. DBM mark Session a' + against inferred type `a1 b' + In the second argument of `($)', namely + ... +</PRE +><P +>Another way of rewriting it is like this, where we separate the + <TT +><A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +></TT +> action into another function: +</P +><PRE +> {-# OPTIONS -fglasgow-exts #-} + module Main where + import Database.Sqlite.Enumerator + import Control.Monad.Trans (liftIO) + main = flip catchDB reportRethrow $ + withSession (connect "sqlite_db") hello + + hello = withTransaction RepeatableRead $ do + let iter (s::String) (_::String) = result s + result <- doQuery (sql "select 'Hello world.'") iter "" + liftIO (putStrLn result) +</PRE +><P +>which gives this error: +</P +><PRE +> Main.hs:9:2: + Inferred type is less polymorphic than expected + Quantified type variable `mark' is mentioned in the environment: + hello :: DBM mark Session () (bound at Main.hs:15:0) + ... +</PRE +><P +>This is just the monomorphism restriction in action. + Sans a type signature, the function hello is monomorphised + (that is, mark is replaced with (), per GHC rules). + This is easily fixed by adding this type declaration: +</P +><PRE +> hello :: DBM mark Session () +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="5" +>Bind Parameters +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>Support for bind variables varies between DBMS's. +</P +><P +>We call <TT +><A HREF="Database-Enumerator.html#v%3AwithPreparedStatement" +>withPreparedStatement</A +></TT +> function to prepare + the statement, and then call <TT +><A HREF="Database-Enumerator.html#v%3AwithBoundStatement" +>withBoundStatement</A +></TT +> + to provide the bind values and execute the query. + The value returned by <TT +><A HREF="Database-Enumerator.html#v%3AwithBoundStatement" +>withBoundStatement</A +></TT +> + is an instance of the <TT +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +></TT +> class, + so it can be passed to <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> for result-set processing. +</P +><P +>When we call <TT +><A HREF="Database-Enumerator.html#v%3AwithPreparedStatement" +>withPreparedStatement</A +></TT +>, we must pass + it a "preparation action", which is simply an action that returns + the prepared query. The function to create this action varies between backends, + and by convention is called <TT +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AprepareQuery" +>prepareQuery</A +></TT +>. + For DML statements, you must use <TT +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AprepareCommand" +>prepareCommand</A +></TT +>, + as the library needs to do something different depending on whether or not the + statement returns a result-set. +</P +><P +>For queries with large result-sets, we provide + <TT +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AprepareLargeQuery" +>prepareLargeQuery</A +></TT +>, + which takes an extra parameter: the number of rows to prefetch + in a network call to the server. + This aids performance in two ways: + 1. you can limit the number of rows that come back to the + client, in order to use less memory, and + 2. the client library will cache rows, so that a network call to + the server is not required for every row processed. +</P +><P +>With PostgreSQL, we must specify the types of the bind parameters + when the query is prepared, so the <TT +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AprepareQuery" +>prepareQuery</A +></TT +> + function takes a list of <TT +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AbindType" +>bindType</A +></TT +> values. + Also, PostgreSQL requires that prepared statements are named, + although you can use "" as the name. +</P +><P +>With Sqlite and Oracle, we simply pass the query text to + <TT +><A HREF="Database-PostgreSQL-Sqlite.html#v%3AprepareQuery" +>prepareQuery</A +></TT +>, + so things are slightly simpler for these backends. +</P +><P +>Perhaps an example will explain it better: +</P +><PRE +> postgresBindExample = do + let + query = sql "select blah from blahblah where id = ? and code = ?" + iter :: (Monad m) => String -> IterAct m [String] + iter s acc = result $ s:acc + bindVals = [bindP (12345::Int), bindP "CODE123"] + bindTypes = [bindType (0::Int), bindType ""] + withPreparedStatement (prepareQuery "stmt1" query bindTypes) $ \pstmt -> do + withBoundStatement pstmt bindVals $ \bstmt -> do + actual <- doQuery bstmt iter [] + liftIO (print actual) +</PRE +><P +>Note that we pass <TT +>bstmt</TT +> to <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +>; + this is the bound statement object created by + <TT +><A HREF="Database-Enumerator.html#v%3AwithBoundStatement" +>withBoundStatement</A +></TT +>. +</P +><P +>The Oracle/Sqlite example code is almost the same, except for the + call to <TT +><A HREF="Database-Sqlite-Enumerator.html#v%3AprepareQuery" +>prepareQuery</A +></TT +>: +</P +><PRE +> sqliteBindExample = do + let + query = sql "select blah from blahblah where id = ? and code = ?" + iter :: (Monad m) => String -> IterAct m [String] + iter s acc = result $ s:acc + bindVals = [bindP (12345::Int), bindP "CODE123"] + withPreparedStatement (prepareQuery query) $ \pstmt -> do + withBoundStatement pstmt bindVals $ \bstmt -> do + actual <- doQuery bstmt iter [] + liftIO (print actual) +</PRE +><P +>It can be a bit tedious to always use the <TT +>withPreparedStatement+withBoundStatement</TT +> + combination, so for the case where you don't plan to re-use the query, + we support a short-cut for bundling the query text and parameters. + The next example is valid for PostgreSQL, Sqlite, and Oracle + (the Sqlite implementation provides a dummy <TT +><A HREF="Database-Sqlite-Enumerator.html#v%3Aprefetch" +>prefetch</A +></TT +> + function to ensure we have a consistent API). + Sqlite has no facility for prefetching - it's an embedded database, so no + network round-trip - so the Sqlite implementation ignores the prefetch count: +</P +><PRE +> bindShortcutExample = do + let + iter :: (Monad m) => String -> IterAct m [String] + iter s acc = result $ s:acc + bindVals = [bindP (12345::Int), bindP "CODE123"] + query = prefetch 1000 "select blah from blahblah where id = ? and code = ?" bindVals + actual <- doQuery query iter [] + liftIO (print actual) +</PRE +><P +>A caveat of using prefetch with PostgreSQL is that you must be inside a transaction. + This is because the PostgreSQL implementation uses a cursor and "FETCH FORWARD" + to implement fetching a block of rows in a single network call, + and PostgreSQL requires that cursors are only used inside transactions. + It can be as simple as wrapping calls to <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> by + <TT +><A HREF="Database-Enumerator.html#v%3AwithTransaction" +>withTransaction</A +></TT +>, + or you may prefer to delimit your transactions elsewhere (the API supports + <TT +><A HREF="Database-InternalEnumerator.html#v%3AbeginTransaction" +>beginTransaction</A +></TT +> and + <TT +><A HREF="Database-InternalEnumerator.html#v%3Acommit" +>commit</A +></TT +>, if you prefer to use them): +</P +><PRE +> withTransaction RepeatableRead $ do + actual <- doQuery query iter [] + liftIO (print actual) +</PRE +><P +>You may have noticed that For <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TT +> and <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +></TT +> literal + bind values, we have to tell the compiler the type of the literal. + I assume this is due to interaction (which I don't fully understand and therefore + cannot explain in any detail) with the numeric literal defaulting mechanism. + For non-numeric literals the compiler can determine the correct types to use. +</P +><P +>If you omit type information for numeric literals, from GHC the error + message looks something like this: +</P +><PRE +> Database/PostgreSQL/Test/Enumerator.lhs:194:4: + Overlapping instances for Database.InternalEnumerator.DBBind a + Session + Database.PostgreSQL.PGEnumerator.PreparedStmt + Database.PostgreSQL.PGEnumerator.BindObj + arising from use of `bindP' at Database/PostgreSQL/Test/Enumerator.lhs:194:4-8 + Matching instances: + Imported from Database.PostgreSQL.PGEnumerator: + instance (Database.InternalEnumerator.DBBind (Maybe a) + Session + Database.PostgreSQL.PGEnumerator.PreparedStmt + Database.PostgreSQL.PGEnumerator.BindObj) => + Database.InternalEnumerator.DBBind a + Session + Database.PostgreSQL.PGEnumerator.PreparedStmt + Database.PostgreSQL.PGEnumerator.BindObj + Imported from Database.PostgreSQL.PGEnumerator: + instance Database.InternalEnumerator.DBBind (Maybe Double) + .... +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="6" +>Multiple (and nested) Result Sets +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="doc" +><P +>Support for returning multiple result sets from a single + statement exists for PostgreSQL and Oracle. + Such functionality does not exist in Sqlite. +</P +><P +>The general idea is to invoke a database procedure or function which + returns cursor variables. The variables can be processed by + <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> in one of two styles: linear or nested. +</P +><P +><EM +>Linear style:</EM +> +</P +><P +>If we assume the existence of the following PostgreSQL function + (this function is used in the test suite in <A HREF="Database-PostgreSQL-Test-Enumerator.html" +>Database.PostgreSQL.Test.Enumerator</A +>): +</P +><PRE +> CREATE OR REPLACE FUNCTION takusenTestFunc() RETURNS SETOF refcursor AS $$ + DECLARE refc1 refcursor; refc2 refcursor; + BEGIN + OPEN refc1 FOR SELECT n*n from t_natural where n < 10 order by 1; + RETURN NEXT refc1; + OPEN refc2 FOR SELECT n, n*n, n*n*n from t_natural where n < 10 order by 1; + RETURN NEXT refc2; + END;$$ LANGUAGE plpgsql; +</PRE +><P +>... then this code shows how linear processing of cursors would be done: +</P +><PRE +> withTransaction RepeatableRead $ do + withPreparedStatement (prepareQuery "stmt1" (sql "select * from takusenTestFunc()") []) $ \pstmt -> do + withBoundStatement pstmt [] $ \bstmt -> do + dummy <- doQuery bstmt iterMain [] + result1 <- doQuery (NextResultSet pstmt) iterRS1 [] + result2 <- doQuery (NextResultSet pstmt) iterRS2 [] + where + iterMain :: (Monad m) => (RefCursor String) -> IterAct m [RefCursor String] + iterMain c acc = result (acc ++ [c]) + iterRS1 :: (Monad m) => Int -> IterAct m [Int] + iterRS1 i acc = result (acc ++ [i]) + iterRS2 :: (Monad m) => Int -> Int -> Int -> IterAct m [(Int, Int, Int)] + iterRS2 i i2 i3 acc = result (acc ++ [(i, i2, i3)]) +</PRE +><P +>Notes: +</P +><UL +><LI +> the use of a <TT +><A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +></TT +> <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TT +> + type in the iteratee function indicates + to the backend that it should save each cursor value returned, + which it does by stuffing them into a list attached to the + prepared statement object. + This means that we <EM +>must</EM +> use <TT +><A HREF="Database-Enumerator.html#v%3AwithPreparedStatement" +>withPreparedStatement</A +></TT +> + to create a prepared statement object; the prepared statament oject + is the container for the cursors returned. +</LI +><LI +> in this example we choose to discard the results of the first iteratee. + This is not necessary, but in this case the only column is a + <TT +><A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +></TT +>, and the values are already saved + in the prepared statement object. +</LI +><LI +> saved cursors are consumed one-at-a-time by calling <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +>, + passing <TT +><A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +></TT +> <TT +>pstmt</TT +> + (i.e. passing the prepared statement oject wrapped by + <TT +><A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +></TT +>). + This simply pulls the next cursor off the list + - they're processed in the order they were pushed on (FIFO) - + and processes it with the given iteratee. +</LI +><LI +> if you try to process too many cursors i.e. make too many calls + to <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> passing <TT +><A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +></TT +> <TT +>pstmt</TT +>, + then an exception will be thrown. + OTOH, failing to process returned cursors will not raise errors, + but the cursors will remain open on the server according to whatever scoping + rules the sever applies. + For PostgreSQL, this will be until the transaction (or session) ends. +</LI +></UL +><P +><EM +>Nested style:</EM +> +</P +><P +>The linear style of cursor processing is the only style supported by + MS SQL Server and ODBC (which we do not yet support). + However, PostgreSQL and Oracle also support using nested cursors in queries. +</P +><P +>Again for PostgreSQL, assuming we have these functions in the database: +</P +><PRE +> CREATE OR REPLACE FUNCTION takusenTestFunc(lim int4) RETURNS refcursor AS $$ + DECLARE refc refcursor; + BEGIN + OPEN refc FOR SELECT n, takusenTestFunc2(n) from t_natural where n < lim order by n; + RETURN refc; + END; $$ LANGUAGE plpgsql; +</PRE +><PRE +> CREATE OR REPLACE FUNCTION takusenTestFunc2(lim int4) RETURNS refcursor AS $$ + DECLARE refc refcursor; + BEGIN + OPEN refc FOR SELECT n from t_natural where n < lim order by n; + RETURN refc; + END; $$ LANGUAGE plpgsql; +</PRE +><P +>... then this code shows how nested queries might work: +</P +><PRE +> selectNestedMultiResultSet = do + let + q = "SELECT n, takusenTestFunc(n) from t_natural where n < 10 order by n" + iterMain (i::Int) (c::RefCursor String) acc = result' ((i,c):acc) + iterInner (i::Int) (c::RefCursor String) acc = result' ((i,c):acc) + iterInner2 (i::Int) acc = result' (i:acc) + withTransaction RepeatableRead $ do + rs <- doQuery (sql q) iterMain [] + flip mapM_ rs $ \(outer, c) -> do + rs <- doQuery c iterInner [] + flip mapM_ rs $ \(inner, c) -> do + rs <- doQuery c iterInner2 [] + flip mapM_ rs $ \i -> do + liftIO (putStrLn (show outer ++ " " ++ show inner ++ " " ++ show i)) +</PRE +><P +>Just to make it clear: the outer query returns a result-set that includes + a <TT +><A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +></TT +> column. Each cursor from that column is passed to + <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> to process it's result-set; + here we use <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#v%3AmapM_" +>mapM_</A +></TT +> to apply an IO action to the list returned by + <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +>. +</P +><P +>For Oracle the example is slightly different. + The reason it's different is that: +</P +><UL +><LI +> Oracle requires that the parent cursor must remain open + while processing the children + (in the PostgreSQL example, <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> + closes the parent cursor after constructing the list, + before the list is processed. This is OK because PostgreSQL + keeps the child cursors open on the server until they are explicitly + closed, or the transaction or session ends). +</LI +><LI +> our current Oracle implementation prevents marshalling + of the cursor in the result-set buffer to a Haskell value, + so each fetch overwrites the buffer value with a new cursor. + This means you have to fully process a given cursor before + fetching the next one. +</LI +></UL +><P +>Contrast this with the PostgreSQL example above, + where the entire result-set is processed to give a + list of RefCursor values, and then we run a list of actions + over this list with <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#v%3AmapM_" +>mapM_</A +></TT +>. + This is possible because PostgreSQL refcursors are just the + database cursor names, which are Strings, which we can marshal + to Haskell values easily. +</P +><PRE +> selectNestedMultiResultSet = do + let + q = "select n, cursor(SELECT nat2.n, cursor" + ++ " (SELECT nat3.n from t_natural nat3 where nat3.n < nat2.n order by n)" + ++ " from t_natural nat2 where nat2.n < nat.n order by n)" + ++ " from t_natural nat where n < 10 order by n" + iterMain (outer::Int) (c::RefCursor StmtHandle) acc = do + rs <- doQuery c (iterInner outer) [] + result' ((outer,c):acc) + iterInner outer (inner::Int) (c::RefCursor StmtHandle) acc = do + rs <- doQuery c (iterInner2 outer inner) [] + result' ((inner,c):acc) + iterInner2 outer inner (i::Int) acc = do + liftIO (putStrLn (show outer ++ " " ++ show inner ++ " " ++ show i)) + result' (i:acc) + withTransaction RepeatableRead $ do + rs <- doQuery (sql q) iterMain [] + return () +</PRE +><P +>Note that the PostgreSQL example can also be written like this + (except, of course, that the actual query text is that + from the PostgreSQL example). +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="7" +>Sessions and Transactions +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ADBM" +></A +><B +>DBM</B +> mark sess a</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBM')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBM" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> si => <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark si)</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess, ??? a sess) => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a)</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess, ??? a sess) => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO" +>MonadIO</A +> (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a)</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwithSession" +></A +><B +>withSession</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess) => <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> sess -> (<SPAN CLASS="keyword" +>forall</SPAN +> mark . <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="doc" +>Typeable constraint is to prevent the leakage of Session and other + marked objects. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwithContinuedSession" +></A +><B +>withContinuedSession</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess) => <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> sess -> (<SPAN CLASS="keyword" +>forall</SPAN +> mark . <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (a, <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> sess)</TD +></TR +><TR +><TD CLASS="doc" +><P +>Persistent database connections. + This issue has been brought up by Shanky Surana. The following design + is inspired by that exchange. +</P +><P +>On one hand, implementing persistent connections is easy. One may say we should + have added them long time ago, to match HSQL, HDBC, and similar + database interfaces. Alas, implementing persistent connection + safely is another matter. The simplest design is like the following +</P +><PRE +> withContinuedSession :: (Typeable a, IE.ISession sess) => + IE.ConnectA sess -> (forall mark. DBM mark sess a) -> + IO (a, IE.ConnectA sess) + withContinuedSession (IE.ConnectA connecta) m = do + conn <- connecta + r <- runReaderT (unDBM m) conn + return (r,(return conn)) +</PRE +><P +>so that the connection object is returned as the result and can be + used again with withContinuedSession or withSession. The problem is + that nothing prevents us from writing: +</P +><PRE +> (r1,conn) <- withContinuedSession (connect "...") query1 + r2 <- withSession conn query2 + r3 <- withSession conn query3 +</PRE +><P +>That is, we store the suspended connection and then use it twice. + But the first withSession closes the connection. So, the second + withSession gets an invalid session object. Invalid in a sense that + even memory may be deallocated, so there is no telling what happens + next. Also, as we can see, it is difficult to handle errors and + automatically dispose of the connections if the fatal error is + encountered. +</P +><P +>All these problems are present in other interfaces... In the + case of a suspended connection, the problem is how to enforce the + <EM +>linear</EM +> access to a variable. It can be enforced, via a + state-changing monad. The implementation below makes + the non-linear use of a suspended connection a run-time checkable + condition. It will be generic and safe - fatal errors close the + connection, an attempt to use a closed connection raises an error, and + we cannot reuse a connection. We have to write: +</P +><PRE +> (r1, conn1) <- withContinuedSession conn ... + (r2, conn2) <- withContinuedSession conn1 ... + (r3, conn3) <- withContinuedSession conn2 ... +</PRE +><P +>etc. If we reuse a suspended connection or use a closed connection, + we get a run-time (exception). That is of course not very + satisfactory - and yet better than a segmentation fault. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acommit" +></A +><B +>commit</B +> :: <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> s => <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Arollback" +></A +><B +>rollback</B +> :: <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> s => <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbeginTransaction" +></A +><B +>beginTransaction</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Reader.html#t%3AMonadReader" +>MonadReader</A +> s (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Reader.html#t%3AReaderT" +>ReaderT</A +> s <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +>), <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> s) => <A HREF="Database-Enumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +> -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwithTransaction" +></A +><B +>withTransaction</B +> :: <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> s => <A HREF="Database-Enumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +> -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a</TD +></TR +><TR +><TD CLASS="doc" +>Perform an action as a transaction: commit afterwards, + unless there was an exception, in which case rollback. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AIsolationLevel" +></A +><B +>IsolationLevel</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AReadUncommitted" +></A +><B +>ReadUncommitted</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3AReadCommitted" +></A +><B +>ReadCommitted</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ARepeatableRead" +></A +><B +>RepeatableRead</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ASerialisable" +></A +><B +>Serialisable</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ASerializable" +></A +><B +>Serializable</B +></TD +><TD CLASS="rdoc" +>for alternative spellers +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IsolationLevel')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IsolationLevel" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-Enumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexecDDL" +></A +><B +>execDDL</B +> :: <A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> stmt s => stmt -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s ()</TD +></TR +><TR +><TD CLASS="doc" +>DDL operations don't manipulate data, so we return no information. + If there is a problem, an exception will be raised. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexecDML" +></A +><B +>execDML</B +> :: <A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> stmt s => stmt -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>Returns the number of rows affected. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="8" +>Exceptions and handlers +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ADBException" +></A +><B +>DBException</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ADBError" +></A +><B +>DBError</B +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>DBMS error message. +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBFatal" +></A +><B +>DBFatal</B +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBUnexpectedNull" +></A +><B +>DBUnexpectedNull</B +> <A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +> <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +></TD +><TD CLASS="rdoc" +>the iteratee function used for queries accepts both nullable (Maybe) and + non-nullable types. If the query itself returns a null in a column where a + non-nullable type was specified, we can't handle it, so DBUnexpectedNull is thrown. +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBNoData" +></A +><B +>DBNoData</B +></TD +><TD CLASS="rdoc" +>Thrown by cursor functions if you try to fetch after the end. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBException')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBException" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbasicDBExceptionReporter" +></A +><B +>basicDBExceptionReporter</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> m ()</TD +></TR +><TR +><TD CLASS="doc" +>This simple handler reports the error to <TT +>stdout</TT +> and swallows it + i.e. it doesn't propagate. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AreportRethrow" +></A +><B +>reportRethrow</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> m ()</TD +></TR +><TR +><TD CLASS="doc" +>This handler reports the error and propagates it + (usually to force the program to halt). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AformatDBException" +></A +><B +>formatDBException</B +> :: <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcatchDB" +></A +><B +>catchDB</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => m a -> (<A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> m a) -> m a</TD +></TR +><TR +><TD CLASS="doc" +>Catch <TT +><A HREF="Database-InteralEnumerator.html#t%3ADBException" +>DBException</A +></TT +>s thrown in the <TT +><A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +></TT +> + monad. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcatchDBError" +></A +><B +>catchDBError</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> m a -> (<A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> m a) -> m a</TD +></TR +><TR +><TD CLASS="doc" +>If you want to trap a specific error number, use this. + It passes anything else up. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AignoreDBError" +></A +><B +>ignoreDBError</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> m a -> m a</TD +></TR +><TR +><TD CLASS="doc" +>Analogous to <TT +><A HREF="Database-Enumerator.html#v%3AcatchDBError" +>catchDBError</A +></TT +>, but ignores specific errors instead + (propagates anything else). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowDB" +></A +><B +>throwDB</B +> :: <A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +> -> a</TD +></TR +><TR +><TD CLASS="doc" +>Throw a DBException. It's just a type-specific <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#v%3AthrowDyn" +>throwDyn</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="9" +>Preparing and Binding +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3APreparedStmt" +></A +><B +>PreparedStmt</B +> mark stmt</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3APreparedStmt" +></A +><B +>PreparedStmt</B +> stmt</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwithPreparedStatement" +></A +><B +>withPreparedStatement</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> stmt sess bstmt bo)</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> sess stmt</TD +><TD CLASS="rdoc" +>preparation action to create prepared statement; + this action is usually created by <TT +>prepareQuery/Command</TT +> +</TD +></TR +><TR +><TD CLASS="arg" +>-> (<A HREF="Database-Enumerator.html#t%3APreparedStmt" +>PreparedStmt</A +> mark stmt -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a)</TD +><TD CLASS="rdoc" +>DBM action that takes a prepared statement +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +><P +>Prepare a statement and run a DBM action over it. + This gives us the ability to re-use a statement, + for example by passing different bind values for each execution. +</P +><P +>The Typeable constraint is to prevent the leakage of marked things. + The type of bound statements should not be exported (and should not be + in Typeable) so the bound statement can't leak either. +</P +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwithBoundStatement" +></A +><B +>withBoundStatement</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> stmt s bstmt bo)</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> <A HREF="Database-Enumerator.html#t%3APreparedStmt" +>PreparedStmt</A +> mark stmt</TD +><TD CLASS="rdoc" +>prepared statement created by withPreparedStatement +</TD +></TR +><TR +><TD CLASS="arg" +>-> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> s stmt bo]</TD +><TD CLASS="rdoc" +>bind values +</TD +></TR +><TR +><TD CLASS="arg" +>-> (bstmt -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a)</TD +><TD CLASS="rdoc" +>action to run over bound statement +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +><P +>Applies a prepared statement to bind variables to get a bound statement, + which is passed to the provided action. + Note that by the time it is passed to the action, the query or command + has usually been executed. + A bound statement would normally be an instance of + <TT +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +></TT +>, so it can be passed to + <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +> + in order to process the result-set, and also an instance of + <TT +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +></TT +>, so that we can write + re-usable DML statements (inserts, updates, deletes). +</P +><P +>The Typeable constraint is to prevent the leakage of marked things. + The type of bound statements should not be exported (and should not be + in Typeable) so the bound statement can't leak either. +</P +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindP" +></A +><B +>bindP</B +> :: <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a sess stmt bo => a -> <A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo</TD +></TR +><TR +><TD CLASS="doc" +>This is really just a wrapper that lets us write lists of + heterogenous bind values e.g. <TT +>[bindP <A HREF="string.html" +>string</A +>, bindP (0::Int), ...]</TT +> +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="10" +>Iteratees and Cursors +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdoQuery" +></A +><B +>doQuery</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: (<A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> stmt sess q, QueryIteratee (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess) q i seed b, <A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> q sess b)</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> stmt</TD +><TD CLASS="rdoc" +>query +</TD +></TR +><TR +><TD CLASS="arg" +>-> i</TD +><TD CLASS="rdoc" +>iteratee function +</TD +></TR +><TR +><TD CLASS="arg" +>-> seed</TD +><TD CLASS="rdoc" +>seed value +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess seed</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>The left-fold interface. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AIterResult" +></A +><B +>IterResult</B +> seedType = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Either.html#t%3AEither" +>Either</A +> seedType seedType</TD +></TR +><TR +><TD CLASS="doc" +><TT +><A HREF="Database-Enumerator.html#t%3AIterResult" +>IterResult</A +></TT +> and <TT +><A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +></TT +> give us some type sugar. + Without them, the types of iteratee functions become + quite unwieldy. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AIterAct" +></A +><B +>IterAct</B +> m seedType = seedType -> m (<A HREF="Database-Enumerator.html#t%3AIterResult" +>IterResult</A +> seedType)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcurrentRowNum" +></A +><B +>currentRowNum</B +> :: <A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> q sess b => q -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ANextResultSet" +></A +><B +>NextResultSet</B +> mark stmt</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ANextResultSet" +></A +><B +>NextResultSet</B +> (<A HREF="Database-Enumerator.html#t%3APreparedStmt" +>PreparedStmt</A +> mark stmt)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:NextResultSet')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:NextResultSet" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +> mark PreparedStmtObj) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +> mark PreparedStmtObj) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ARefCursor" +></A +><B +>RefCursor</B +> a</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ARefCursor" +></A +><B +>RefCursor</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:RefCursor')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:RefCursor" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcursorIsEOF" +></A +><B +>cursorIsEOF</B +> :: DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s) a -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>cursorIsEOF's return value tells you if there are any more rows or not. + If you call <TT +><A HREF="Database-Enumerator.html#v%3AcursorNext" +>cursorNext</A +></TT +> when there are no more rows, + a <TT +><A HREF="Database-Enumerator.html#v%3ADBNoData" +>DBNoData</A +></TT +> exception is thrown. + Cursors are automatically closed and freed when: +</P +><UL +><LI +> the iteratee returns <TT +>Left a</TT +> +</LI +><LI +> the query result-set is exhausted. +</LI +></UL +><P +>To make life easier, we've created a <TT +><A HREF="Database-Enumerator.html#v%3AwithCursor" +>withCursor</A +></TT +> function, + which will clean up if an error (exception) occurs, + or the code exits early. + You can nest them to get interleaving, if you desire: +</P +><PRE +> withCursor query1 iter1 [] $ \c1 -> do + withCursor query2 iter2 [] $ \c2 -> do + r1 <- cursorCurrent c1 + r2 <- cursorCurrent c2 + ... + return something +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcursorCurrent" +></A +><B +>cursorCurrent</B +> :: DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s) a -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s a</TD +></TR +><TR +><TD CLASS="doc" +>Returns the results fetched so far, processed by iteratee function. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcursorNext" +></A +><B +>cursorNext</B +> :: DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s) a -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s (DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark s) a)</TD +></TR +><TR +><TD CLASS="doc" +>Advance the cursor. Returns the cursor. The return value is usually ignored. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwithCursor" +></A +><B +>withCursor</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> stmt sess q, QueryIteratee (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess) q i seed b, <A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> q sess b)</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> stmt</TD +><TD CLASS="rdoc" +>query +</TD +></TR +><TR +><TD CLASS="arg" +>-> i</TD +><TD CLASS="rdoc" +>iteratee function +</TD +></TR +><TR +><TD CLASS="arg" +>-> seed</TD +><TD CLASS="rdoc" +>seed value +</TD +></TR +><TR +><TD CLASS="arg" +>-> (DBCursor mark (<A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess) seed -> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a)</TD +><TD CLASS="rdoc" +>action taking cursor parameter +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Enumerator.html#t%3ADBM" +>DBM</A +> mark sess a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>Ensures cursor resource is properly tidied up in exceptional cases. + Propagates exceptions after closing cursor. + The Typeable constraint is to prevent cursors and other marked values + (like cursor computations) from escaping. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="11" +>Utilities +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AifNull" +></A +><B +>ifNull</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a</TD +><TD CLASS="rdoc" +>nullable value +</TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>value to substitute if first parameter is null i.e. <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#v%3ANothing" +>Nothing</A +></TT +> +</TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>Useful utility function, for SQL weenies. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aresult" +></A +><B +>result</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m a</TD +></TR +><TR +><TD CLASS="doc" +>Another useful utility function. + Use this to return a value from an iteratee function (the one passed to + <TT +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>doQuery</A +></TT +>). + Note that you should probably nearly always use the strict version. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aresult%27" +></A +><B +>result'</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m a</TD +></TR +><TR +><TD CLASS="doc" +>A strict version. This is recommended unless you have a specific need for laziness, + as the lazy version will gobble stack and heap. + If you have a large result-set (in the order of 10-100K rows or more), + it is likely to exhaust the standard 1M GHC stack. + Whether or not <TT +><A HREF="Database-Enumerator.html#v%3Aresult" +>result</A +></TT +> eats memory depends on what <TT +>x</TT +> does: + if it's a delayed computation then it almost certainly will. + This includes consing elements onto a list, + and arithmetic operations (counting, summing, etc). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-InternalEnumerator.html view
@@ -0,0 +1,3072 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.InternalEnumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.InternalEnumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="#1" +>Session object. +</A +></DT +><DT +><A HREF="#2" +>Exceptions and handlers +</A +></DT +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>This is the interface between the middle Enumerator layer and the + low-level, Database-specific layer. This file is not exported to the end user. +</P +><P +>Only the programmer for a new back-end needs to consult this file. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AISession" +>ISession</A +> sess <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3Adisconnect" +>disconnect</A +> :: sess -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbeginTransaction" +>beginTransaction</A +> :: sess -> <A HREF="Database-InternalEnumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Acommit" +>commit</A +> :: sess -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Arollback" +>rollback</A +> :: sess -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3AConnectA" +>ConnectA</A +> sess = <A HREF="#v%3AConnectA" +>ConnectA</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> sess)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3AStatement" +>Statement</A +> stmt sess q | stmt sess -> q <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AmakeQuery" +>makeQuery</A +> :: sess -> stmt -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> q</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3ACommand" +>Command</A +> stmt sess <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AexecuteCommand" +>executeCommand</A +> :: sess -> stmt -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3APreparationA" +>PreparationA</A +> sess stmt = <A HREF="#v%3APreparationA" +>PreparationA</A +> (sess -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> stmt)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3AIPrepared" +>IPrepared</A +> stmt sess bound_stmt bo | stmt -> bound_stmt, stmt -> bo <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindRun" +>bindRun</A +> :: sess -> stmt -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo] -> (bound_stmt -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdestroyStmt" +>destroyStmt</A +> :: sess -> stmt -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3ABindA" +>BindA</A +> sess stmt bo = <A HREF="#v%3ABindA" +>BindA</A +> (sess -> stmt -> bo)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3ADBBind" +>DBBind</A +> a sess stmt bo | stmt -> bo <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindP" +>bindP</A +> :: a -> <A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AIsolationLevel" +>IsolationLevel</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3AReadUncommitted" +>ReadUncommitted</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3AReadCommitted" +>ReadCommitted</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ARepeatableRead" +>RepeatableRead</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ASerialisable" +>Serialisable</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ASerializable" +>Serializable</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3APosition" +>Position</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A HREF="#t%3AIQuery" +>IQuery</A +> q sess b | q -> sess, q -> b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AfetchOneRow" +>fetchOneRow</A +> :: q -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcurrentRowNum" +>currentRowNum</A +> :: q -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfreeBuffer" +>freeBuffer</A +> :: q -> b -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdestroyQuery" +>destroyQuery</A +> :: q -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3ADBType" +>DBType</A +> a q b | q -> b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AallocBufferFor" +>allocBufferFor</A +> :: a -> q -> <A HREF="Database-InternalEnumerator.html#t%3APosition" +>Position</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> b</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfetchCol" +>fetchCol</A +> :: q -> b -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowIfDBNull" +>throwIfDBNull</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => m (<A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +>, <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +>) -> m (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) -> m a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ADBException" +>DBException</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ADBError" +>DBError</A +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBFatal" +>DBFatal</A +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBUnexpectedNull" +>DBUnexpectedNull</A +> <A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +> <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADBNoData" +>DBNoData</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowDB" +>throwDB</A +> :: <A HREF="Database-InternalEnumerator.html#t%3ADBException" +>DBException</A +> -> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AColNum" +>ColNum</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ARowNum" +>RowNum</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlState" +>SqlState</A +> = (<A HREF="Database-InternalEnumerator.html#t%3ASqlStateClass" +>SqlStateClass</A +>, <A HREF="Database-InternalEnumerator.html#t%3ASqlStateSubClass" +>SqlStateSubClass</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlStateClass" +>SqlStateClass</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqlStateSubClass" +>SqlStateSubClass</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="1" +>Session object. +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t%3AISession" +></A +><B +>ISession</B +> sess <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>The <TT +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +></TT +> class describes a database session to a particular + DBMS. Oracle has its own Session object, SQLite has its own + session object (which maintains the connection handle to the database + engine and other related stuff). Session objects for different databases + normally have different types -- yet they all belong to the class ISession + so we can do generic operations like <TT +>commit</TT +>, <TT +>execDDL</TT +>, etc. + in a database-independent manner. +</P +><P +>Session objects per se are created by database connection/login functions. +</P +><P +>The class <TT +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +></TT +> is thus an interface between low-level (and + database-specific) code and the Enumerator, database-independent + code. + The <TT +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +></TT +> class is NOT visible to the end user -- neither the class, + nor any of its methods. +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3Adisconnect" +></A +><B +>disconnect</B +> :: sess -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbeginTransaction" +></A +><B +>beginTransaction</B +> :: sess -> <A HREF="Database-InternalEnumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acommit" +></A +><B +>commit</B +> :: sess -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Arollback" +></A +><B +>rollback</B +> :: sess -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:ISession')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:ISession" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3AConnectA" +></A +><B +>ConnectA</B +> sess</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>A wrapper around the action to open the database. That wrapper is not + exported to the end user. The only reason for the wrapper is to + guarantee that the only thing to do with the result of + <TT +><A HREF="Database-Enumerator-Sqlite.html#v%3Aconnect" +>connect</A +></TT +> function is to pass it out + directly to <TT +><A HREF="Database-Enumerator.html#v%3AwithSession" +>withSession</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AConnectA" +></A +><B +>ConnectA</B +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> sess)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3AStatement" +></A +><B +>Statement</B +> stmt sess q | stmt sess -> q <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><TT +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +></TT +> defines the API for query objects i.e. + which types can be queries. +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AmakeQuery" +></A +><B +>makeQuery</B +> :: sess -> stmt -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> q</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Statement')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Statement" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> PreparedStmtObj <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> PreparedStmtObj <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> StmtBind <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +> mark PreparedStmtObj) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +> mark PreparedStmtObj) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3ACommand" +></A +><B +>Command</B +> stmt sess <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><TT +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +></TT +> is not a query: command deletes or updates rows, creates/drops + tables, or changes database state. + <TT +><A HREF="Database-InternalEnumerator.html#v%3AexecuteCommand" +>executeCommand</A +></TT +> returns the number of affected rows (or 0 if DDL i.e. not DML). +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AexecuteCommand" +></A +><B +>executeCommand</B +> :: sess -> stmt -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Command')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Command" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> CommandBind <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> CommandBind <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryStringTuned <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> StmtBind <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3APreparationA" +></A +><B +>PreparationA</B +> sess stmt</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>This type is not visible to the end user (cf. ConnectA). It forms a private + `communication channel' between Database.Enumerator and a back end. +</P +><P +>Why don't we make a user-visible class with a <TT +>prepare</TT +> method? + Because it means to standardize the preparation method signature + across all databases. Some databases need more parameters, some + fewer. There may be several statement preparation functions within one + database. So, instead of standardizing the signature of the + preparation function, we standardize on the _result_ of that + function. To be more precise, we standardize on the properties of the + result: whatever it is, the eventual prepared statement should be + suitable to be passed to <TT +><A HREF="Database-InternalEnumerator.html#v%3AbindRun" +>bindRun</A +></TT +>. +</P +></TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3APreparationA" +></A +><B +>PreparationA</B +> (sess -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> stmt)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3AIPrepared" +></A +><B +>IPrepared</B +> stmt sess bound_stmt bo | stmt -> bound_stmt, stmt -> bo <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AbindRun" +></A +><B +>bindRun</B +> :: sess -> stmt -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo] -> (bound_stmt -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdestroyStmt" +></A +><B +>destroyStmt</B +> :: sess -> stmt -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IPrepared')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IPrepared" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3ABindA" +></A +><B +>BindA</B +> sess stmt bo</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>The binding object (bo) below is very abstract, on purpose. + It may be |IO a|, it may be String, it may be a function, etc. + The binding object can hold the result of marshalling, + or bo can hold the current counter, etc. + Different databases do things very differently: + compare PostgreSQL and the Stub (which models Oracle). +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ABindA" +></A +><B +>BindA</B +> (sess -> stmt -> bo)</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3ADBBind" +></A +><B +>DBBind</B +> a sess stmt bo | stmt -> bo <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>The class DBBind is not used by the end-user. + It is used to tie up low-level database access and the enumerator. + A database-specific library must provide a set of instances for DBBind. + The latter are the dual of DBType. +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AbindP" +></A +><B +>bindP</B +> :: a -> <A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> sess stmt bo</TD +></TR +><TR +><TD CLASS="doc" +>This is really just a wrapper that lets us write lists of + heterogenous bind values e.g. <TT +>[bindP <A HREF="string.html" +>string</A +>, bindP (0::Int), ...]</TT +> +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBBind')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBBind" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AFloat" +>Float</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AIsolationLevel" +></A +><B +>IsolationLevel</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AReadUncommitted" +></A +><B +>ReadUncommitted</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3AReadCommitted" +></A +><B +>ReadCommitted</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ARepeatableRead" +></A +><B +>RepeatableRead</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ASerialisable" +></A +><B +>Serialisable</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ASerializable" +></A +><B +>Serializable</B +></TD +><TD CLASS="rdoc" +>for alternative spellers +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IsolationLevel')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IsolationLevel" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-InternalEnumerator.html#t%3AIsolationLevel" +>IsolationLevel</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3APosition" +></A +><B +>Position</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> sess => <A NAME="t%3AIQuery" +></A +><B +>IQuery</B +> q sess b | q -> sess, q -> b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>The class IQuery describes the class of query objects. Each + database (that is, each Session object) has its own Query object. + We may assume that a Query object includes (at least, conceptually) + a (pointer to) a Session object, so a Query object determines the + Session object. + A back-end provides an instance (or instances) of IQuery. + The end user never seens the IQuery class (let alone its methods). +</P +><P +>Can a session have several types of query objects? + Let's assume that it can: but a statement plus the session uniquely + determine the query, +</P +><P +>Note that we explicitly use IO monad because we will have to explicitly + do FFI. +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AfetchOneRow" +></A +><B +>fetchOneRow</B +> :: q -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcurrentRowNum" +></A +><B +>currentRowNum</B +> :: q -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfreeBuffer" +></A +><B +>freeBuffer</B +> :: q -> b -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdestroyQuery" +></A +><B +>destroyQuery</B +> :: q -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IQuery')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IQuery" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t%3ADBType" +></A +><B +>DBType</B +> a q b | q -> b <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>A 'buffer' means a column buffer: a data structure that points to a + block of memory allocated for the values of one particular + column. Since a query normally fetches a row of several columns, we + typically deal with a list of column buffers. Although the column data + are typed (e.g., Integer, CalendarDate, etc), column buffers hide that + type. Think of the column buffer as Dynamics. The class DBType below + describes marshalling functions, to fetch a typed value out of the + 'untyped' columnBuffer. +</P +><P +>Different DBMS's (that is, different session objects) have, in + general, columnBuffers of different types: the type of Column Buffer + is specific to a database. + So, ISession (m) uniquely determines the buffer type (b)?? + Or, actually, a query uniquely determines the buffer. +</P +><P +>The class DBType is not used by the end-user. + It is used to tie up low-level database access and the enumerator. + A database-specific library must provide a set of instances for DBType. +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AallocBufferFor" +></A +><B +>allocBufferFor</B +> :: a -> q -> <A HREF="Database-InternalEnumerator.html#t%3APosition" +>Position</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> b</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfetchCol" +></A +><B +>fetchCol</B +> :: q -> b -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBType')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBType" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> a Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AFloat" +>Float</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Read.html#t%3ARead" +>Read</A +> a) => <A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +>) Query ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>DBType</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) Query ColumnBuffer</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowIfDBNull" +></A +><B +>throwIfDBNull</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => m (<A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +>, <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +>) -> m (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) -> m a</TD +></TR +><TR +><TD CLASS="doc" +>Used by instances of DBType to throw an exception + when a null (Nothing) is returned. + Will work for any type, as you pass the fetch action in the fetcher arg. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +><A NAME="2" +>Exceptions and handlers +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ADBException" +></A +><B +>DBException</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ADBError" +></A +><B +>DBError</B +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>DBMS error message. +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBFatal" +></A +><B +>DBFatal</B +> <A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>SqlState</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBUnexpectedNull" +></A +><B +>DBUnexpectedNull</B +> <A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>RowNum</A +> <A HREF="Database-InternalEnumerator.html#t%3AColNum" +>ColNum</A +></TD +><TD CLASS="rdoc" +>the iteratee function used for queries accepts both nullable (Maybe) and + non-nullable types. If the query itself returns a null in a column where a + non-nullable type was specified, we can't handle it, so DBUnexpectedNull is thrown. +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADBNoData" +></A +><B +>DBNoData</B +></TD +><TD CLASS="rdoc" +>Thrown by cursor functions if you try to fetch after the end. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBException')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBException" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-InternalEnumerator.html#t%3ADBException" +>DBException</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Database-InternalEnumerator.html#t%3ADBException" +>DBException</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowDB" +></A +><B +>throwDB</B +> :: <A HREF="Database-InternalEnumerator.html#t%3ADBException" +>DBException</A +> -> a</TD +></TR +><TR +><TD CLASS="doc" +>Throw a DBException. It's just a type-specific <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#v%3AthrowDyn" +>throwDyn</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AColNum" +></A +><B +>ColNum</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ARowNum" +></A +><B +>RowNum</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlState" +></A +><B +>SqlState</B +> = (<A HREF="Database-InternalEnumerator.html#t%3ASqlStateClass" +>SqlStateClass</A +>, <A HREF="Database-InternalEnumerator.html#t%3ASqlStateSubClass" +>SqlStateSubClass</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlStateClass" +></A +><B +>SqlStateClass</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqlStateSubClass" +></A +><B +>SqlStateSubClass</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Oracle-Enumerator.html view
@@ -0,0 +1,1070 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Oracle.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Oracle.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Oracle OCI implementation of Database.Enumerator. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ASession" +>Session</A +> </TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aconnect" +>connect</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareStmt" +>prepareStmt</A +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApreparePrefetch" +>preparePrefetch</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareQuery" +>prepareQuery</A +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareLargeQuery" +>prepareLargeQuery</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareCommand" +>prepareCommand</A +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareLargeCommand" +>prepareLargeCommand</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Asql" +>sql</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Asqlbind" +>sqlbind</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aprefetch" +>prefetch</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Acmdbind" +>cmdbind</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> CommandBind</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AStmtHandle" +>StmtHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A HREF="#t%3AOut" +>Out</A +> a = <A HREF="#v%3AOut" +>Out</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="Database-Enumerator.html" +>Database.Enumerator</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ASession" +></A +><B +>Session</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Session')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Session" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> CommandBind <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> PreparedStmtObj <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="Database-Oracle-Enumerator.html#t%3AStmtHandle" +>StmtHandle</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Database-Oracle-Enumerator.html#t%3AStmtHandle" +>StmtHandle</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +> mark PreparedStmtObj) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aconnect" +></A +><B +>connect</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareStmt" +></A +><B +>prepareStmt</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApreparePrefetch" +></A +><B +>preparePrefetch</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareQuery" +></A +><B +>prepareQuery</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareLargeQuery" +></A +><B +>prepareLargeQuery</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareCommand" +></A +><B +>prepareCommand</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareLargeCommand" +></A +><B +>prepareLargeCommand</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="doc" +>Seems like an odd alternative to <TT +><A HREF="Database-Oracle-Enumerator.html#v%3AprepareCommand" +>prepareCommand</A +></TT +> (what is a large command?) + but is actually useful for when the outer query it a procedure call that + returns one or more cursors. The prefetch count for the inner cursors is + inherited from the outer statement, which in this case is a command, rather + than a select. Normally prefetch would be irrelevant (and indeed it is for + the outer command), but we also save it in the statement so that it can be + reused for the child cursors. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asql" +></A +><B +>sql</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asqlbind" +></A +><B +>sqlbind</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aprefetch" +></A +><B +>prefetch</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acmdbind" +></A +><B +>cmdbind</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> CommandBind</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AStmtHandle" +></A +><B +>StmtHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>newtype</SPAN +> <A NAME="t%3AOut" +></A +><B +>Out</B +> a</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AOut" +></A +><B +>Out</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Out')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Out" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Database-Oracle-Enumerator.html#t%3AStmtHandle" +>StmtHandle</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Out</A +> a) <A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="Database-Enumerator.html" +>Database.Enumerator</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Oracle-OCIConstants.html view
@@ -0,0 +1,1195 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Oracle.OCIConstants</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Oracle.OCIConstants</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="#1" +>Used all over the place: +</A +></DT +><DT +><A HREF="#2" +>Handle types: +</A +></DT +><DT +><A HREF="#3" +>Error code types: +</A +></DT +><DT +><A HREF="#4" +>Attribute types: +</A +></DT +><DT +><A HREF="#5" +>Authentication options: +</A +></DT +><DT +><A HREF="#6" +>Syntax types (i.e. does the DBMS understand v7 or v8 syntax, etc): +</A +></DT +><DT +><A HREF="#7" +>Scrollable Cursor Options: +</A +></DT +><DT +><A HREF="#8" +>OCI datatypes: +</A +></DT +><DT +><A HREF="#9" +>Transaction types; parameters for ociTransStart. +</A +></DT +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Contains CInt equivalents of the #defines in the oci library headers. + This is not a complete set; just enough to get the Haskell libraries working. + This also might not be particularly portable, but I don't think Oracle are going + to change these in a hurry (that would break compiled programs, wouldn't it?). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_DEFAULT" +>oci_DEFAULT</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_CRED_RDBMS" +>oci_CRED_RDBMS</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_CRED_EXT" +>oci_CRED_EXT</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_CRED_PROXY" +>oci_CRED_PROXY</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_NTV_SYNTAX" +>oci_NTV_SYNTAX</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_FETCH_NEXT" +>oci_FETCH_NEXT</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_FETCH_FIRST" +>oci_FETCH_FIRST</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_FETCH_LAST" +>oci_FETCH_LAST</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_FETCH_PRIOR" +>oci_FETCH_PRIOR</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_FETCH_ABSOLUTE" +>oci_FETCH_ABSOLUTE</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_FETCH_RELATIVE" +>oci_FETCH_RELATIVE</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_FETCH_RESERVED" +>oci_FETCH_RESERVED</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_CHR" +>oci_SQLT_CHR</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_NUM" +>oci_SQLT_NUM</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_INT" +>oci_SQLT_INT</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_FLT" +>oci_SQLT_FLT</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_STR" +>oci_SQLT_STR</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_VNU" +>oci_SQLT_VNU</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_LNG" +>oci_SQLT_LNG</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_VCS" +>oci_SQLT_VCS</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_RID" +>oci_SQLT_RID</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_DAT" +>oci_SQLT_DAT</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_VBI" +>oci_SQLT_VBI</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_BIN" +>oci_SQLT_BIN</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_LBI" +>oci_SQLT_LBI</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_UIN" +>oci_SQLT_UIN</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_LVC" +>oci_SQLT_LVC</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_LVB" +>oci_SQLT_LVB</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_AFC" +>oci_SQLT_AFC</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_AVC" +>oci_SQLT_AVC</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_SQLT_RSET" +>oci_SQLT_RSET</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_TRANS_READONLY" +>oci_TRANS_READONLY</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_TRANS_READWRITE" +>oci_TRANS_READWRITE</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aoci_TRANS_SERIALIZABLE" +>oci_TRANS_SERIALIZABLE</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="1" +>Used all over the place: +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_DEFAULT" +></A +><B +>oci_DEFAULT</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="2" +>Handle types: +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="3" +>Error code types: +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="4" +>Attribute types: +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="5" +>Authentication options: +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_CRED_RDBMS" +></A +><B +>oci_CRED_RDBMS</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="doc" +>Found in $ORAHOME/oci/include/oci.h +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_CRED_EXT" +></A +><B +>oci_CRED_EXT</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_CRED_PROXY" +></A +><B +>oci_CRED_PROXY</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="6" +>Syntax types (i.e. does the DBMS understand v7 or v8 syntax, etc): +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_NTV_SYNTAX" +></A +><B +>oci_NTV_SYNTAX</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="doc" +>Found in $ORAHOME/oci/include/oci.h +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="7" +>Scrollable Cursor Options: +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_FETCH_NEXT" +></A +><B +>oci_FETCH_NEXT</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="doc" +>Found in $ORAHOME/oci/include/oci.h +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_FETCH_FIRST" +></A +><B +>oci_FETCH_FIRST</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_FETCH_LAST" +></A +><B +>oci_FETCH_LAST</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_FETCH_PRIOR" +></A +><B +>oci_FETCH_PRIOR</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_FETCH_ABSOLUTE" +></A +><B +>oci_FETCH_ABSOLUTE</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_FETCH_RELATIVE" +></A +><B +>oci_FETCH_RELATIVE</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_FETCH_RESERVED" +></A +><B +>oci_FETCH_RESERVED</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="8" +>OCI datatypes: +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_CHR" +></A +><B +>oci_SQLT_CHR</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="doc" +>Found in $ORAHOME/oci/include/ocidfn.h +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_NUM" +></A +><B +>oci_SQLT_NUM</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_INT" +></A +><B +>oci_SQLT_INT</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_FLT" +></A +><B +>oci_SQLT_FLT</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_STR" +></A +><B +>oci_SQLT_STR</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_VNU" +></A +><B +>oci_SQLT_VNU</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_LNG" +></A +><B +>oci_SQLT_LNG</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_VCS" +></A +><B +>oci_SQLT_VCS</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_RID" +></A +><B +>oci_SQLT_RID</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_DAT" +></A +><B +>oci_SQLT_DAT</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_VBI" +></A +><B +>oci_SQLT_VBI</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_BIN" +></A +><B +>oci_SQLT_BIN</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_LBI" +></A +><B +>oci_SQLT_LBI</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_UIN" +></A +><B +>oci_SQLT_UIN</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_LVC" +></A +><B +>oci_SQLT_LVC</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_LVB" +></A +><B +>oci_SQLT_LVB</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_AFC" +></A +><B +>oci_SQLT_AFC</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_AVC" +></A +><B +>oci_SQLT_AVC</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_SQLT_RSET" +></A +><B +>oci_SQLT_RSET</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="9" +>Transaction types; parameters for ociTransStart. +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_TRANS_READONLY" +></A +><B +>oci_TRANS_READONLY</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="doc" +>Found in $ORAHOME/oci/include/oci.h. + There are more than this, but they're related to complicated + transaction-management stuff in the OCI libraries that I don't understand. + These should be sufficient to support the simple transaction model + understood by most developers. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_TRANS_READWRITE" +></A +><B +>oci_TRANS_READWRITE</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aoci_TRANS_SERIALIZABLE" +></A +><B +>oci_TRANS_SERIALIZABLE</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Oracle-OCIFunctions.html view
@@ -0,0 +1,6130 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Oracle.OCIFunctions</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Oracle.OCIFunctions</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="#1" +>Foreign OCI functions +</A +></DT +><DT +><A HREF="#2" +>OCI error reporting +</A +></DT +><DT +><A HREF="#3" +>Allocating Handles (i.e. creating OCI data structures, and memory management) +</A +></DT +><DT +><A HREF="#4" +>Connecting and detaching +</A +></DT +><DT +><A HREF="#5" +>Transactions +</A +></DT +><DT +><A HREF="#6" +>Issuing queries +</A +></DT +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>Simple wrappers for OCI functions (FFI). +</P +><P +>The functions in this file are simple wrappers for OCI functions. + The wrappers add error detection and exceptions; + functions in this module raise <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +></TT +>. + The next layer up traps these and turns them into <TT +><A HREF="Database-Enumerator.html#t%3ADBException" +>DBException</A +></TT +>. +</P +><P +>Note that <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +></TT +> <EM +>does not</EM +> contain the error number and text + returned by <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AgetOCIErrorMsg" +>getOCIErrorMsg</A +></TT +>. + It is the job of the next layer (module) up to catch the <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +></TT +> + and then call <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AgetOCIErrorMsg" +>getOCIErrorMsg</A +></TT +> to get the actual error details. + The <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +></TT +> simply contains the error number returned by + the OCI call, and some text identifying the wrapper function. + See <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatErrorCodeDesc" +>formatErrorCodeDesc</A +></TT +> for the set of possible values for the OCI error numbers. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AOCIStruct" +>OCIStruct</A +> = <A HREF="#v%3AOCIStruct" +>OCIStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AOCIHandle" +>OCIHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIStruct" +>OCIStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AOCIBuffer" +>OCIBuffer</A +> = <A HREF="#v%3AOCIBuffer" +>OCIBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ABufferPtr" +>BufferPtr</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>OCIBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ABufferFPtr" +>BufferFPtr</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>OCIBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AColumnResultBuffer" +>ColumnResultBuffer</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>OCIBuffer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ABindBuffer" +>BindBuffer</A +> = (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>OCIBuffer</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AContext" +>Context</A +> = <A HREF="#v%3AContext" +>Context</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AContextPtr" +>ContextPtr</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AContext" +>Context</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AEnvStruct" +>EnvStruct</A +> = <A HREF="#v%3AEnvStruct" +>EnvStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AEnvHandle" +>EnvHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvStruct" +>EnvStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AErrorStruct" +>ErrorStruct</A +> = <A HREF="#v%3AErrorStruct" +>ErrorStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AErrorHandle" +>ErrorHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorStruct" +>ErrorStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AServerStruct" +>ServerStruct</A +> = <A HREF="#v%3AServerStruct" +>ServerStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AServerHandle" +>ServerHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerStruct" +>ServerStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AUserStruct" +>UserStruct</A +> = <A HREF="#v%3AUserStruct" +>UserStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AUserHandle" +>UserHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AUserStruct" +>UserStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AConnStruct" +>ConnStruct</A +> = <A HREF="#v%3AConnStruct" +>ConnStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AConnHandle" +>ConnHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnStruct" +>ConnStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ASessStruct" +>SessStruct</A +> = <A HREF="#v%3ASessStruct" +>SessStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASessHandle" +>SessHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessStruct" +>SessStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AStmtStruct" +>StmtStruct</A +> = <A HREF="#v%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AStmtHandle" +>StmtHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ADefnStruct" +>DefnStruct</A +> = <A HREF="#v%3ADefnStruct" +>DefnStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ADefnHandle" +>DefnHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ADefnStruct" +>DefnStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AParamStruct" +>ParamStruct</A +> = <A HREF="#v%3AParamStruct" +>ParamStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AParamHandle" +>ParamHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AParamStruct" +>ParamStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ABindStruct" +>BindStruct</A +> = <A HREF="#v%3ABindStruct" +>BindStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ABindHandle" +>BindHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindStruct" +>BindStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AColumnInfo" +>ColumnInfo</A +> = (<A HREF="Database-Oracle-OCIFunctions.html#t%3ADefnHandle" +>DefnHandle</A +>, <A HREF="Database-Oracle-OCIFunctions.html#t%3AColumnResultBuffer" +>ColumnResultBuffer</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AOCIException" +>OCIException</A +> = <A HREF="#v%3AOCIException" +>OCIException</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcatchOCI" +>catchOCI</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> (<A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowOCI" +>throwOCI</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkCInt" +>mkCInt</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkCShort" +>mkCShort</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkCUShort" +>mkCUShort</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcStrLen" +>cStrLen</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcStr" +>cStr</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociEnvCreate" +>ociEnvCreate</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociHandleAlloc" +>ociHandleAlloc</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociHandleFree" +>ociHandleFree</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociErrorGet" +>ociErrorGet</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociParamGet" +>ociParamGet</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociAttrGet" +>ociAttrGet</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociAttrSet" +>ociAttrSet</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociLogon" +>ociLogon</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociLogoff" +>ociLogoff</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociSessionBegin" +>ociSessionBegin</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociSessionEnd" +>ociSessionEnd</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociServerAttach" +>ociServerAttach</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>ServerHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociServerDetach" +>ociServerDetach</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>ServerHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociTerminate" +>ociTerminate</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociTransStart" +>ociTransStart</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociTransCommit" +>ociTransCommit</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociTransRollback" +>ociTransRollback</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociStmtPrepare" +>ociStmtPrepare</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociDefineByPos" +>ociDefineByPos</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ADefnHandle" +>DefnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociStmtExecute" +>ociStmtExecute</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociStmtFetch" +>ociStmtFetch</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociBindByPos" +>ociBindByPos</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AociBindDynamic" +>ociBindDynamic</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>ContextPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackInBind" +>OCICallbackInBind</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>ContextPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackOutBind" +>OCICallbackOutBind</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AOCICallbackInBind" +>OCICallbackInBind</A +> = <A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>ContextPtr</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AOCICallbackOutBind" +>OCICallbackOutBind</A +> = <A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>ContextPtr</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +>) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkOCICallbackInBind" +>mkOCICallbackInBind</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackInBind" +>OCICallbackInBind</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackInBind" +>OCICallbackInBind</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkOCICallbackOutBind" +>mkOCICallbackOutBind</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackOutBind" +>OCICallbackOutBind</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackOutBind" +>OCICallbackOutBind</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetOCIErrorMsg2" +>getOCIErrorMsg2</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetOCIErrorMsg" +>getOCIErrorMsg</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfromEnumOCIErrorCode" +>fromEnumOCIErrorCode</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AformatErrorCodeDesc" +>formatErrorCodeDesc</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AformatOCIMsg" +>formatOCIMsg</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AformatMsgCommon" +>formatMsgCommon</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AformatErrorMsg" +>formatErrorMsg</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AformatEnvMsg" +>formatEnvMsg</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtestForError" +>testForError</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtestForErrorWithPtr" +>testForErrorWithPtr</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AenvCreate" +>envCreate</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AhandleAlloc" +>handleAlloc</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AhandleFree" +>handleFree</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetHandleAttr" +>setHandleAttr</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetHandleAttrString" +>setHandleAttrString</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetHandleAttr" +>getHandleAttr</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetParam" +>getParam</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AParamHandle" +>ParamHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdbLogon" +>dbLogon</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdbLogoff" +>dbLogoff</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aterminate" +>terminate</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AserverDetach" +>serverDetach</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>ServerHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AserverAttach" +>serverAttach</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>ServerHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetSession" +>getSession</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsessionBegin" +>sessionBegin</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsessionEnd" +>sessionEnd</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbeginTrans" +>beginTrans</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcommitTrans" +>commitTrans</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ArollbackTrans" +>rollbackTrans</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtPrepare" +>stmtPrepare</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtExecute" +>stmtExecute</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefineByPos" +>defineByPos</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AColumnInfo" +>ColumnInfo</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Asbph" +>sbph</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindByPos" +>bindByPos</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindOutputByPos" +>bindOutputByPos</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindBuffer" +>BindBuffer</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtFetch" +>stmtFetch</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmaybeBufferNull" +>maybeBufferNull</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AnullByte" +>nullByte</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACChar" +>CChar</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcShort2Int" +>cShort2Int</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcUShort2Int" +>cUShort2Int</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcuCharToInt" +>cuCharToInt</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUChar" +>CUChar</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbyteToInt" +>byteToInt</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUChar" +>CUChar</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToString" +>bufferToString</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AColumnInfo" +>ColumnInfo</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmakeYear" +>makeYear</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmakeYearByte" +>makeYearByte</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmakeCentByte" +>makeCentByte</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdumpBuffer" +>dumpBuffer</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToCaltime" +>bufferToCaltime</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToUTCTime" +>bufferToUTCTime</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetBufferByte" +>setBufferByte</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcalTimeToBuffer" +>calTimeToBuffer</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AutcTimeToBuffer" +>utcTimeToBuffer</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> UTCTime -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferPeekValue" +>bufferPeekValue</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToA" +>bufferToA</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToCInt" +>bufferToCInt</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToInt" +>bufferToInt</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToCDouble" +>bufferToCDouble</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACDouble" +>CDouble</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToDouble" +>bufferToDouble</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbufferToStmtHandle" +>bufferToStmtHandle</A +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AOCIStruct" +></A +><B +>OCIStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><UL +><LI +> Each handle type has its own data type, to prevent stupid errors + i.e. using the wrong handle at the wrong time. +</LI +><LI +> In GHC you can simply say <TT +>data OCIStruct</TT +> i.e. there's no need for <TT +>= OCIStruct</TT +>. + I've decided to be more portable, as it doesn't cost much. +</LI +><LI +> Use castPtr if you need to convert handles (say <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +></TT +> to a more specific type, or vice versa). +</LI +></UL +></TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AOCIStruct" +></A +><B +>OCIStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AOCIHandle" +></A +><B +>OCIHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIStruct" +>OCIStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AOCIBuffer" +></A +><B +>OCIBuffer</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AOCIBuffer" +></A +><B +>OCIBuffer</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ABufferPtr" +></A +><B +>BufferPtr</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>OCIBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ABufferFPtr" +></A +><B +>BufferFPtr</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>OCIBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AColumnResultBuffer" +></A +><B +>ColumnResultBuffer</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>OCIBuffer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ABindBuffer" +></A +><B +>BindBuffer</B +> = (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>OCIBuffer</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AContext" +></A +><B +>Context</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AContext" +></A +><B +>Context</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AContextPtr" +></A +><B +>ContextPtr</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AContext" +>Context</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AEnvStruct" +></A +><B +>EnvStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AEnvStruct" +></A +><B +>EnvStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AEnvHandle" +></A +><B +>EnvHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvStruct" +>EnvStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AErrorStruct" +></A +><B +>ErrorStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AErrorStruct" +></A +><B +>ErrorStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AErrorHandle" +></A +><B +>ErrorHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorStruct" +>ErrorStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AServerStruct" +></A +><B +>ServerStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AServerStruct" +></A +><B +>ServerStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AServerHandle" +></A +><B +>ServerHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerStruct" +>ServerStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AUserStruct" +></A +><B +>UserStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AUserStruct" +></A +><B +>UserStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AUserHandle" +></A +><B +>UserHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AUserStruct" +>UserStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AConnStruct" +></A +><B +>ConnStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AConnStruct" +></A +><B +>ConnStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AConnHandle" +></A +><B +>ConnHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnStruct" +>ConnStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ASessStruct" +></A +><B +>SessStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ASessStruct" +></A +><B +>SessStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASessHandle" +></A +><B +>SessHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessStruct" +>SessStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AStmtStruct" +></A +><B +>StmtStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AStmtStruct" +></A +><B +>StmtStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AStmtHandle" +></A +><B +>StmtHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ADefnStruct" +></A +><B +>DefnStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ADefnStruct" +></A +><B +>DefnStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ADefnHandle" +></A +><B +>DefnHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ADefnStruct" +>DefnStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AParamStruct" +></A +><B +>ParamStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AParamStruct" +></A +><B +>ParamStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AParamHandle" +></A +><B +>ParamHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AParamStruct" +>ParamStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ABindStruct" +></A +><B +>BindStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ABindStruct" +></A +><B +>BindStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ABindHandle" +></A +><B +>BindHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindStruct" +>BindStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AColumnInfo" +></A +><B +>ColumnInfo</B +> = (<A HREF="Database-Oracle-OCIFunctions.html#t%3ADefnHandle" +>DefnHandle</A +>, <A HREF="Database-Oracle-OCIFunctions.html#t%3AColumnResultBuffer" +>ColumnResultBuffer</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AOCIException" +></A +><B +>OCIException</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Low-level, OCI library errors. +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AOCIException" +></A +><B +>OCIException</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:OCIException')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:OCIException" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcatchOCI" +></A +><B +>catchOCI</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> (<A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowOCI" +></A +><B +>throwOCI</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkCInt" +></A +><B +>mkCInt</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkCShort" +></A +><B +>mkCShort</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkCUShort" +></A +><B +>mkCUShort</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcStrLen" +></A +><B +>cStrLen</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcStr" +></A +><B +>cStr</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="1" +>Foreign OCI functions +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociEnvCreate" +></A +><B +>ociEnvCreate</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociHandleAlloc" +></A +><B +>ociHandleAlloc</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociHandleFree" +></A +><B +>ociHandleFree</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociErrorGet" +></A +><B +>ociErrorGet</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociParamGet" +></A +><B +>ociParamGet</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociAttrGet" +></A +><B +>ociAttrGet</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociAttrSet" +></A +><B +>ociAttrSet</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociLogon" +></A +><B +>ociLogon</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociLogoff" +></A +><B +>ociLogoff</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociSessionBegin" +></A +><B +>ociSessionBegin</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociSessionEnd" +></A +><B +>ociSessionEnd</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociServerAttach" +></A +><B +>ociServerAttach</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>ServerHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociServerDetach" +></A +><B +>ociServerDetach</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>ServerHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociTerminate" +></A +><B +>ociTerminate</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociTransStart" +></A +><B +>ociTransStart</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociTransCommit" +></A +><B +>ociTransCommit</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociTransRollback" +></A +><B +>ociTransRollback</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociStmtPrepare" +></A +><B +>ociStmtPrepare</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociDefineByPos" +></A +><B +>ociDefineByPos</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ADefnHandle" +>DefnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociStmtExecute" +></A +><B +>ociStmtExecute</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociStmtFetch" +></A +><B +>ociStmtFetch</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociBindByPos" +></A +><B +>ociBindByPos</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AociBindDynamic" +></A +><B +>ociBindDynamic</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>ContextPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackInBind" +>OCICallbackInBind</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>ContextPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackOutBind" +>OCICallbackOutBind</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AOCICallbackInBind" +></A +><B +>OCICallbackInBind</B +> = <A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>ContextPtr</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AOCICallbackOutBind" +></A +><B +>OCICallbackOutBind</B +> = <A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>ContextPtr</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +>) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkOCICallbackInBind" +></A +><B +>mkOCICallbackInBind</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackInBind" +>OCICallbackInBind</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackInBind" +>OCICallbackInBind</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkOCICallbackOutBind" +></A +><B +>mkOCICallbackOutBind</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackOutBind" +>OCICallbackOutBind</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackOutBind" +>OCICallbackOutBind</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="2" +>OCI error reporting +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetOCIErrorMsg2" +></A +><B +>getOCIErrorMsg2</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="doc" +>This is just an auxiliary function for getOCIErrorMsg. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetOCIErrorMsg" +></A +><B +>getOCIErrorMsg</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfromEnumOCIErrorCode" +></A +><B +>fromEnumOCIErrorCode</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AformatErrorCodeDesc" +></A +><B +>formatErrorCodeDesc</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AformatOCIMsg" +></A +><B +>formatOCIMsg</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="doc" +>Given the two parts of an <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +></TT +> (the error number and text) + get the actual error message from the DBMS and construct an error message + from all of these pieces. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AformatMsgCommon" +></A +><B +>formatMsgCommon</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="doc" +>We have two format functions: <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatEnvMsg" +>formatEnvMsg</A +></TT +> takes the <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +></TT +>, + <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatErrorMsg" +>formatErrorMsg</A +></TT +> takes the <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +></TT +>. + They're just type-safe wrappers for <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatMsgCommon" +>formatMsgCommon</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AformatErrorMsg" +></A +><B +>formatErrorMsg</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AformatEnvMsg" +></A +><B +>formatEnvMsg</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>OCIException</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtestForError" +></A +><B +>testForError</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="doc" +><P +>The testForError functions are the only places where OCIException is thrown, + so if you want to change or embellish it, your changes will be localised here. + These functions factor out common error handling code + from the OCI wrapper functions that follow. +</P +><P +>Typically an OCI wrapper function would look like: +</P +><PRE +> handleAlloc handleType env = alloca ptr -> do + rc <- ociHandleAlloc env ptr handleType 0 nullPtr + if rc < 0 + then throwOCI (OCIException rc msg) + else return () +</PRE +><P +>where the code from <TT +>if rc < 0</TT +> onwards was identical. + <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AtestForError" +>testForError</A +></TT +> replaces the code from <TT +>if rc < 0 ...</TT +> onwards. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtestForErrorWithPtr" +></A +><B +>testForErrorWithPtr</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="doc" +>Like <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AtestForError" +>testForError</A +></TT +> but when the value you want to return + is at the end of a pointer. + Either there was an error, in which case the pointer probably isn't valid, + or there is something at the end of the pointer to return. + See <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AdbLogon" +>dbLogon</A +></TT +> and <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AgetHandleAttr" +>getHandleAttr</A +></TT +> for example usage. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="3" +>Allocating Handles (i.e. creating OCI data structures, and memory management) +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AenvCreate" +></A +><B +>envCreate</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AhandleAlloc" +></A +><B +>handleAlloc</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AhandleFree" +></A +><B +>handleFree</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsetHandleAttr" +></A +><B +>setHandleAttr</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsetHandleAttrString" +></A +><B +>setHandleAttrString</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetHandleAttr" +></A +><B +>getHandleAttr</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>OCIHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetParam" +></A +><B +>getParam</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AParamHandle" +>ParamHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="4" +>Connecting and detaching +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdbLogon" +></A +><B +>dbLogon</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>EnvHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +></TD +></TR +><TR +><TD CLASS="doc" +>The OCI Logon function doesn't behave as you'd expect when the password is due to expire. + <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociLogon" +>ociLogon</A +></TT +> returns <TT +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SUCCESS_WITH_INFO" +>oci_SUCCESS_WITH_INFO</A +></TT +>, + but the <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +></TT +> returned is not valid. + In this case we have to change <TT +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SUCCESS_WITH_INFO" +>oci_SUCCESS_WITH_INFO</A +></TT +> + to <TT +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_ERROR" +>oci_ERROR</A +></TT +>, + so that the error handling code will catch it and abort. + I don't know why the handle returned isn't valid, + as the logon process should be able to complete successfully in this case. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdbLogoff" +></A +><B +>dbLogoff</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aterminate" +></A +><B +>terminate</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AserverDetach" +></A +><B +>serverDetach</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>ServerHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AserverAttach" +></A +><B +>serverAttach</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>ServerHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetSession" +></A +><B +>getSession</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +></TD +></TR +><TR +><TD CLASS="doc" +>Having established a connection (Service Context), now get the Session. + You can have more than one session per connection, + but I haven't implemented it yet. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsessionBegin" +></A +><B +>sessionBegin</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsessionEnd" +></A +><B +>sessionEnd</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>SessHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="5" +>Transactions +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbeginTrans" +></A +><B +>beginTrans</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcommitTrans" +></A +><B +>commitTrans</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArollbackTrans" +></A +><B +>rollbackTrans</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="6" +>Issuing queries +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtPrepare" +></A +><B +>stmtPrepare</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="doc" +><P +>With the OCI you do queries with these steps: +</P +><UL +><LI +> prepare your statement (it's just a String) - no communication with DBMS +</LI +><LI +> execute it (this sends it to the DBMS for parsing etc) +</LI +><LI +> allocate result set buffers by calling <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AdefineByPos" +>defineByPos</A +></TT +> for each column +</LI +><LI +> call fetch for each row. +</LI +><LI +> call <TT +><A HREF="Database-Oracle-OCIFunctions.html#v%3AhandleFree" +>handleFree</A +></TT +> for the <TT +><A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TT +> + (I assume this is the approved way of terminating the query; + the OCI docs aren't explicit about this.) +</LI +></UL +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtExecute" +></A +><B +>stmtExecute</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>ConnHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdefineByPos" +></A +><B +>defineByPos</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>Position +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>Buffer size in bytes +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +><TD CLASS="rdoc" +>SQL Datatype (from <A HREF="Database-Oracle-OCIConstants.html" +>Database.Oracle.OCIConstants</A +>) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AColumnInfo" +>ColumnInfo</A +></TD +><TD CLASS="rdoc" +>tuple: (DefnHandle, Ptr to buffer, Ptr to null indicator, Ptr to size of value in buffer) +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +><P +>defineByPos allocates memory for a single column value. + The allocated components are: +</P +><UL +><LI +> the result (i.e. value) - you have to say how big with bufsize. +</LI +><LI +> the null indicator (int16) +</LI +><LI +> the size of the returned data (int16) +</LI +></UL +><P +>Previously it was the caller's responsibility to free the memory after they're done with it. + Now we use <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#v%3AmallocForeignPtr" +>mallocForeignPtr</A +></TT +>, so manual memory management is hopefully + a thing of the past. + The caller will also have to cast the data in bufferptr to the expected type + (using <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#v%3AcastPtr" +>castPtr</A +></TT +>). +</P +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asbph" +></A +><B +>sbph</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindByPos" +></A +><B +>bindByPos</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>Position +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +></TD +><TD CLASS="rdoc" +>Null ind: 0 == not null, -1 == null +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +></TD +><TD CLASS="rdoc" +>payload +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>payload size in bytes +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +><TD CLASS="rdoc" +>SQL Datatype (from <A HREF="Database-Oracle-OCIConstants.html" +>Database.Oracle.OCIConstants</A +>) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindOutputByPos" +></A +><B +>bindOutputByPos</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>Position +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindBuffer" +>BindBuffer</A +></TD +><TD CLASS="rdoc" +>triple of (null-ind, payload, output-size) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>payload input size in bytes +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +><TD CLASS="rdoc" +>SQL Datatype (from <A HREF="Database-Oracle-OCIConstants.html" +>Database.Oracle.OCIConstants</A +>) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>BindHandle</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtFetch" +></A +><B +>stmtFetch</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>ErrorHandle</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="doc" +>Fetch a single row into the buffers. + If you have specified a prefetch count > 1 then the row + might already be cached by the OCI library. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmaybeBufferNull" +></A +><B +>maybeBufferNull</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="doc" +>Short-circuit null test: if the buffer contains a null then return Nothing. + Otherwise, run the IO action to extract a value from the buffer and return Just it. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AnullByte" +></A +><B +>nullByte</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACChar" +>CChar</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcShort2Int" +></A +><B +>cShort2Int</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcUShort2Int" +></A +><B +>cUShort2Int</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUShort" +>CUShort</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcuCharToInt" +></A +><B +>cuCharToInt</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUChar" +>CUChar</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbyteToInt" +></A +><B +>byteToInt</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUChar" +>CUChar</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToString" +></A +><B +>bufferToString</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3AColumnInfo" +>ColumnInfo</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmakeYear" +></A +><B +>makeYear</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>Oracle's excess-something-or-other encoding for years: + year = 100*(c - 100) + (y - 100), + c = (year div 100) + 100, + y = (year mod 100) + 100. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmakeYearByte" +></A +><B +>makeYearByte</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmakeCentByte" +></A +><B +>makeCentByte</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdumpBuffer" +></A +><B +>dumpBuffer</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToCaltime" +></A +><B +>bufferToCaltime</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToUTCTime" +></A +><B +>bufferToUTCTime</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsetBufferByte" +></A +><B +>setBufferByte</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcalTimeToBuffer" +></A +><B +>calTimeToBuffer</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AutcTimeToBuffer" +></A +><B +>utcTimeToBuffer</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>BufferPtr</A +> -> UTCTime -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferPeekValue" +></A +><B +>bufferPeekValue</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToA" +></A +><B +>bufferToA</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToCInt" +></A +><B +>bufferToCInt</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToInt" +></A +><B +>bufferToInt</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToCDouble" +></A +><B +>bufferToCDouble</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACDouble" +>CDouble</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToDouble" +></A +><B +>bufferToDouble</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACShort" +>CShort</A +> -> <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbufferToStmtHandle" +></A +><B +>bufferToStmtHandle</B +> :: <A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>BufferFPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Oracle-Test-Enumerator.html view
@@ -0,0 +1,124 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Oracle.Test.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Oracle.Test.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTest" +></A +><B +>runTest</B +> :: <A HREF="Database-Test-Performance.html#t%3AShouldRunTests" +>ShouldRunTests</A +> -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Oracle-Test-OCIFunctions.html view
@@ -0,0 +1,131 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Oracle.Test.OCIFunctions</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Oracle.Test.OCIFunctions</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Test harness for <A HREF="Database-Oracle-OCIFunctions.html" +>Database.Oracle.OCIFunctions</A +>. + This module depends on on <A HREF="Database-Oracle-OCIFunctions.html" +>Database.Oracle.OCIFunctions</A +>. + so it should only use functions from there (and <A HREF="Database-Oracle-OCIConstants.html" +>Database.Oracle.OCIConstants</A +>). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTest" +></A +><B +>runTest</B +> :: [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-PostgreSQL-Enumerator.html view
@@ -0,0 +1,1067 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.PostgreSQL.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.PostgreSQL.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>PostgreSQL implementation of Database.Enumerator. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ASession" +>Session</A +> </TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aconnect" +>connect</A +> :: [<A HREF="Database-PostgreSQL-Enumerator.html#t%3AConnectAttr" +>ConnectAttr</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AConnectAttr" +>ConnectAttr</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ACAhost" +>CAhost</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACAhostaddr" +>CAhostaddr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACAport" +>CAport</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACAdbname" +>CAdbname</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACAuser" +>CAuser</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACApassword" +>CApassword</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACAconnect_timeout" +>CAconnect_timeout</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACAoptions" +>CAoptions</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACAsslmode" +>CAsslmode</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ACAservice" +>CAservice</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareStmt" +>prepareStmt</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApreparePrefetch" +>preparePrefetch</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareQuery" +>prepareQuery</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareLargeQuery" +>prepareLargeQuery</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AprepareCommand" +>prepareCommand</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Asql" +>sql</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Asqlbind" +>sqlbind</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aprefetch" +>prefetch</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Acmdbind" +>cmdbind</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> CommandBind</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindType" +>bindType</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> a => a -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="Database-Enumerator.html" +>Database.Enumerator</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ASession" +></A +><B +>Session</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Session')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Session" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> CommandBind <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ARefCursor" +>RefCursor</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AFloat" +>Float</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> (<A HREF="Database-Enumerator.html#t%3ANextResultSet" +>NextResultSet</A +> mark PreparedStmtObj) <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aconnect" +></A +><B +>connect</B +> :: [<A HREF="Database-PostgreSQL-Enumerator.html#t%3AConnectAttr" +>ConnectAttr</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AConnectAttr" +></A +><B +>ConnectAttr</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Specify connection options to <TT +><A HREF="Database-PostgreSQL-Enumerator.html#v%3Aconnect" +>connect</A +></TT +>. + You only need to use whatever subset is relevant for your connection. +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ACAhost" +></A +><B +>CAhost</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACAhostaddr" +></A +><B +>CAhostaddr</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACAport" +></A +><B +>CAport</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACAdbname" +></A +><B +>CAdbname</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACAuser" +></A +><B +>CAuser</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACApassword" +></A +><B +>CApassword</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACAconnect_timeout" +></A +><B +>CAconnect_timeout</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACAoptions" +></A +><B +>CAoptions</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACAsslmode" +></A +><B +>CAsslmode</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ACAservice" +></A +><B +>CAservice</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareStmt" +></A +><B +>prepareStmt</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApreparePrefetch" +></A +><B +>preparePrefetch</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareQuery" +></A +><B +>prepareQuery</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareLargeQuery" +></A +><B +>prepareLargeQuery</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareCommand" +></A +><B +>prepareCommand</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asql" +></A +><B +>sql</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString</TD +></TR +><TR +><TD CLASS="doc" +>The simplest kind of a statement: no tuning parameters, + all default, little overhead. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asqlbind" +></A +><B +>sqlbind</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aprefetch" +></A +><B +>prefetch</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acmdbind" +></A +><B +>cmdbind</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> CommandBind</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindType" +></A +><B +>bindType</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> a => a -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="doc" +>bindType is useful when constructing the list of Oids for stmtPrepare. + You don't need to pass the actual bind values, just dummy values + of the same type (the value isn't used, so <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3Aundefined" +>undefined</A +></TT +> is OK here). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="Database-Enumerator.html" +>Database.Enumerator</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-PostgreSQL-PGFunctions.html view
@@ -0,0 +1,3874 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.PostgreSQL.PGFunctions</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.PostgreSQL.PGFunctions</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Simple wrappers for PostgreSQL functions (FFI) plus middle-level + wrappers (in the second part of this file) +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ADBHandleStruct" +>DBHandleStruct</A +> = <A HREF="#v%3APGconn" +>PGconn</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ADBHandle" +>DBHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandleStruct" +>DBHandleStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AStmtStruct" +>StmtStruct</A +> = <A HREF="#v%3APGresult" +>PGresult</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AResultSetHandle" +>ResultSetHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AOid" +>Oid</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AFormat" +>Format</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AVoid" +>Void</A +> = ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AParamLen" +>ParamLen</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3APGException" +>PGException</A +> = <A HREF="#v%3APGException" +>PGException</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcatchPG" +>catchPG</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGException" +>PGException</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowPG" +>throwPG</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a => a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> any</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ArethrowPG" +>rethrowPG</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGException" +>PGException</A +> -> any</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcStr" +>cStr</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcStrLen" +>cStrLen</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQconnectdb" +>fPQconnectdb</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQfinish" +>fPQfinish</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQreset" +>fPQreset</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQdb" +>fPQdb</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AConnStatusType" +>ConnStatusType</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQstatus" +>fPQstatus</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AConnStatusType" +>ConnStatusType</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQerrorMessage" +>fPQerrorMessage</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQsetClientEncoding" +>fPQsetClientEncoding</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ANoticeReceiver" +>NoticeReceiver</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ANoticeProcessor" +>NoticeProcessor</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkNoticeReceiver" +>mkNoticeReceiver</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>NoticeReceiver</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>NoticeReceiver</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkNoticeProcessor" +>mkNoticeProcessor</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>NoticeProcessor</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>NoticeProcessor</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQsetNoticeReceiver" +>fPQsetNoticeReceiver</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>NoticeReceiver</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>NoticeReceiver</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQsetNoticeProcessor" +>fPQsetNoticeProcessor</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>NoticeProcessor</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>NoticeProcessor</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQexecParams" +>fPQexecParams</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AVoid" +>Void</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AParamLen" +>ParamLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Format</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQprepare" +>fPQprepare</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQexecPrepared" +>fPQexecPrepared</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AVoid" +>Void</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AParamLen" +>ParamLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Format</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQresultStatus" +>fPQresultStatus</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AExecStatusType" +>ExecStatusType</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AExecStatusType" +>ExecStatusType</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQresultErrorMessage" +>fPQresultErrorMessage</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQclear" +>fPQclear</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQntuples" +>fPQntuples</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQnfields" +>fPQnfields</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQfname" +>fPQfname</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQfformat" +>fPQfformat</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQftype" +>fPQftype</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQgetvalue" +>fPQgetvalue</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQgetisnull" +>fPQgetisnull</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQgetlength" +>fPQgetlength</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQcmdStatus" +>fPQcmdStatus</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQcmdTuples" +>fPQcmdTuples</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQoidValue" +>fPQoidValue</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQputCopyData" +>fPQputCopyData</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQputCopyEnd" +>fPQputCopyEnd</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQgetResult" +>fPQgetResult</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3APGVerbosity" +>PGVerbosity</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfPQsetErrorVerbosity" +>fPQsetErrorVerbosity</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGVerbosity" +>PGVerbosity</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGVerbosity" +>PGVerbosity</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetError" +>getError</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AopenDb" +>openDb</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcloseDb" +>closeDb</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3APGType" +>PGType</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3ApgTypeFormat" +>pgTypeFormat</A +> :: a -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Format</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApgTypeOid" +>pgTypeOid</A +> :: a -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApgNewValue" +>pgNewValue</A +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +>)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApgPeek" +>pgPeek</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApgSize" +>pgSize</A +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3APGBindVal" +>PGBindVal</A +> = <A HREF="#v%3APGBindVal" +>PGBindVal</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3AbindValOid" +>bindValOid</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AbindValFormat" +>bindValFormat</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Format</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AbindValSize" +>bindValSize</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AbindValPtr" +>bindValPtr</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +>))</TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtoCChar" +>toCChar</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACChar" +>CChar</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfromCChar" +>fromCChar</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACChar" +>CChar</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtoCInt" +>toCInt</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Acheck%27stmt" +>check'stmt</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AExecStatusType" +>ExecStatusType</A +> -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtPrepare" +>stmtPrepare</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AnqExec" +>nqExec</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AexecCommand" +>execCommand</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AexecPreparedCommand" +>execPreparedCommand</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtExecImm" +>stmtExecImm</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtExecImm0" +>stmtExecImm0</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtExec0" +>stmtExec0</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtExec0t" +>stmtExec0t</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtExec" +>stmtExec</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AexecPrepared" +>execPrepared</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aprepare%27n%27exec" +>prepare'n'exec</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtFinalise" +>stmtFinalise</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValPtr" +>colValPtr</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolVal" +>colVal</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> a => <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValString" +>colValString</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValInt" +>colValInt</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValInt64" +>colValInt64</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValDouble" +>colValDouble</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValFloat" +>colValFloat</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AFloat" +>Float</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValUTCTime" +>colValUTCTime</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> UTCTime</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValCalTime" +>colValCalTime</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValNull" +>colValNull</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Asbph" +>sbph</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AnqCopyIn_buflen" +>nqCopyIn_buflen</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AnqCopyIn" +>nqCopyIn</A +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AHandle" +>Handle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ADBHandleStruct" +></A +><B +>DBHandleStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3APGconn" +></A +><B +>PGconn</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ADBHandle" +></A +><B +>DBHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandleStruct" +>DBHandleStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AStmtStruct" +></A +><B +>StmtStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3APGresult" +></A +><B +>PGresult</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AResultSetHandle" +></A +><B +>ResultSetHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AOid" +></A +><B +>Oid</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACUInt" +>CUInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AFormat" +></A +><B +>Format</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AVoid" +></A +><B +>Void</B +> = ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AParamLen" +></A +><B +>ParamLen</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3APGException" +></A +><B +>PGException</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3APGException" +></A +><B +>PGException</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:PGException')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:PGException" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGException" +>PGException</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGException" +>PGException</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcatchPG" +></A +><B +>catchPG</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGException" +>PGException</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowPG" +></A +><B +>throwPG</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a => a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> any</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArethrowPG" +></A +><B +>rethrowPG</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGException" +>PGException</A +> -> any</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcStr" +></A +><B +>cStr</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcStrLen" +></A +><B +>cStrLen</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQconnectdb" +></A +><B +>fPQconnectdb</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQfinish" +></A +><B +>fPQfinish</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQreset" +></A +><B +>fPQreset</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQdb" +></A +><B +>fPQdb</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AConnStatusType" +></A +><B +>ConnStatusType</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQstatus" +></A +><B +>fPQstatus</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AConnStatusType" +>ConnStatusType</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQerrorMessage" +></A +><B +>fPQerrorMessage</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQsetClientEncoding" +></A +><B +>fPQsetClientEncoding</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ANoticeReceiver" +></A +><B +>NoticeReceiver</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ANoticeProcessor" +></A +><B +>NoticeProcessor</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkNoticeReceiver" +></A +><B +>mkNoticeReceiver</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>NoticeReceiver</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>NoticeReceiver</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkNoticeProcessor" +></A +><B +>mkNoticeProcessor</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>NoticeProcessor</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>NoticeProcessor</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQsetNoticeReceiver" +></A +><B +>fPQsetNoticeReceiver</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>NoticeReceiver</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>NoticeReceiver</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQsetNoticeProcessor" +></A +><B +>fPQsetNoticeProcessor</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>NoticeProcessor</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> () -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>NoticeProcessor</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQexecParams" +></A +><B +>fPQexecParams</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AVoid" +>Void</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AParamLen" +>ParamLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Format</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQprepare" +></A +><B +>fPQprepare</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQexecPrepared" +></A +><B +>fPQexecPrepared</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AVoid" +>Void</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AParamLen" +>ParamLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Format</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQresultStatus" +></A +><B +>fPQresultStatus</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AExecStatusType" +>ExecStatusType</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AExecStatusType" +></A +><B +>ExecStatusType</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQresultErrorMessage" +></A +><B +>fPQresultErrorMessage</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQclear" +></A +><B +>fPQclear</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQntuples" +></A +><B +>fPQntuples</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQnfields" +></A +><B +>fPQnfields</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQfname" +></A +><B +>fPQfname</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQfformat" +></A +><B +>fPQfformat</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQftype" +></A +><B +>fPQftype</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQgetvalue" +></A +><B +>fPQgetvalue</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQgetisnull" +></A +><B +>fPQgetisnull</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQgetlength" +></A +><B +>fPQgetlength</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQcmdStatus" +></A +><B +>fPQcmdStatus</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQcmdTuples" +></A +><B +>fPQcmdTuples</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQoidValue" +></A +><B +>fPQoidValue</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQputCopyData" +></A +><B +>fPQputCopyData</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQputCopyEnd" +></A +><B +>fPQputCopyEnd</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQgetResult" +></A +><B +>fPQgetResult</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3APGVerbosity" +></A +><B +>PGVerbosity</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfPQsetErrorVerbosity" +></A +><B +>fPQsetErrorVerbosity</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGVerbosity" +>PGVerbosity</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGVerbosity" +>PGVerbosity</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetError" +></A +><B +>getError</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AopenDb" +></A +><B +>openDb</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcloseDb" +></A +><B +>closeDb</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t%3APGType" +></A +><B +>PGType</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3ApgTypeFormat" +></A +><B +>pgTypeFormat</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Format</A +></TD +><TD CLASS="rdoc" +>1 == binary (default), 0 == text +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApgTypeOid" +></A +><B +>pgTypeOid</B +> :: a -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApgNewValue" +></A +><B +>pgNewValue</B +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApgPeek" +></A +><B +>pgPeek</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApgSize" +></A +><B +>pgSize</B +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:PGType')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:PGType" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AFloat" +>Float</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt16" +>Int16</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt32" +>Int32</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AInteger" +>Integer</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> UTCTime</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> a => <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3APGBindVal" +></A +><B +>PGBindVal</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3APGBindVal" +></A +><B +>PGBindVal</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AbindValOid" +></A +><B +>bindValOid</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3AbindValFormat" +></A +><B +>bindValFormat</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Format</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3AbindValSize" +></A +><B +>bindValSize</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3AbindValPtr" +></A +><B +>bindValPtr</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +>))</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtoCChar" +></A +><B +>toCChar</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACChar" +>CChar</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AfromCChar" +></A +><B +>fromCChar</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACChar" +>CChar</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtoCInt" +></A +><B +>toCInt</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acheck%27stmt" +></A +><B +>check'stmt</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AExecStatusType" +>ExecStatusType</A +> -> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtPrepare" +></A +><B +>stmtPrepare</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AnqExec" +></A +><B +>nqExec</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexecCommand" +></A +><B +>execCommand</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexecPreparedCommand" +></A +><B +>execPreparedCommand</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Oid</A +>)</TD +></TR +><TR +><TD CLASS="doc" +>This is for commands, as opposed to queries. + The query equivalent of <TT +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AexecPreparedCommand" +>execPreparedCommand</A +></TT +> is <TT +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AstmtExec" +>stmtExec</A +></TT +>. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtExecImm" +></A +><B +>stmtExecImm</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtExecImm0" +></A +><B +>stmtExecImm0</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtExec0" +></A +><B +>stmtExec0</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtExec0t" +></A +><B +>stmtExec0t</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtExec" +></A +><B +>stmtExec</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexecPrepared" +></A +><B +>execPrepared</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aprepare%27n%27exec" +></A +><B +>prepare'n'exec</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>PGBindVal</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtFinalise" +></A +><B +>stmtFinalise</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValPtr" +></A +><B +>colValPtr</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +>)</TD +></TR +><TR +><TD CLASS="doc" +>Column numbers are zero-indexed, so subtract one + from given index (we present a one-indexed interface). + So are the row numbers. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolVal" +></A +><B +>colVal</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>PGType</A +> a => <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValString" +></A +><B +>colValString</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValInt" +></A +><B +>colValInt</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValInt64" +></A +><B +>colValInt64</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValDouble" +></A +><B +>colValDouble</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValFloat" +></A +><B +>colValFloat</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AFloat" +>Float</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValUTCTime" +></A +><B +>colValUTCTime</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> UTCTime</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValCalTime" +></A +><B +>colValCalTime</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValNull" +></A +><B +>colValNull</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>ResultSetHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asbph" +></A +><B +>sbph</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AnqCopyIn_buflen" +></A +><B +>nqCopyIn_buflen</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AnqCopyIn" +></A +><B +>nqCopyIn</B +> :: <A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AHandle" +>Handle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-PostgreSQL-Test-Enumerator.html view
@@ -0,0 +1,124 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.PostgreSQL.Test.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.PostgreSQL.Test.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTest" +></A +><B +>runTest</B +> :: <A HREF="Database-Test-Performance.html#t%3AShouldRunTests" +>ShouldRunTests</A +> -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-PostgreSQL-Test-PGFunctions.html view
@@ -0,0 +1,122 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.PostgreSQL.Test.PGFunctions</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.PostgreSQL.Test.PGFunctions</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTest" +></A +><B +>runTest</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Sqlite-Enumerator.html view
@@ -0,0 +1,518 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Sqlite.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Sqlite.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Sqlite implementation of Database.Enumerator. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ASession" +></A +><B +>Session</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Session')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Session" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> BoundStmt <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> StmtBind <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> BoundStmt <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> PreparedStmtObj <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> StmtBind <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> a <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>IPrepared</A +> PreparedStmtObj <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> BoundStmt BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>DBBind</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a) <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aconnect" +></A +><B +>connect</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareStmt" +></A +><B +>prepareStmt</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApreparePrefetch" +></A +><B +>preparePrefetch</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareQuery" +></A +><B +>prepareQuery</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareLargeQuery" +></A +><B +>prepareLargeQuery</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AprepareCommand" +></A +><B +>prepareCommand</B +> :: QueryString -> <A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>PreparationA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asql" +></A +><B +>sql</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asqlbind" +></A +><B +>sqlbind</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> StmtBind</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aprefetch" +></A +><B +>prefetch</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> StmtBind</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Acmdbind" +></A +><B +>cmdbind</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="Database-InternalEnumerator.html#t%3ABindA" +>BindA</A +> <A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Session</A +> PreparedStmtObj BindObj] -> StmtBind</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>module <A HREF="Database-Enumerator.html" +>Database.Enumerator</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Sqlite-SqliteFunctions.html view
@@ -0,0 +1,2736 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Sqlite.SqliteFunctions</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Sqlite.SqliteFunctions</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Simple wrappers for Sqlite functions (FFI). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ADBHandleStruct" +>DBHandleStruct</A +> = <A HREF="#v%3ADBHandleStruct" +>DBHandleStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ADBHandle" +>DBHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandleStruct" +>DBHandleStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AStmtStruct" +>StmtStruct</A +> = <A HREF="#v%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AStmtHandle" +>StmtHandle</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ABlob" +>Blob</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ASqliteCallback" +>SqliteCallback</A +> a = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AFreeFunPtr" +>FreeFunPtr</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ())</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ASqliteException" +>SqliteException</A +> = <A HREF="#v%3ASqliteException" +>SqliteException</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcatchSqlite" +>catchSqlite</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> (<A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>SqliteException</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowSqlite" +>throwSqlite</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>SqliteException</A +> -> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteOK" +>sqliteOK</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteERROR" +>sqliteERROR</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteROW" +>sqliteROW</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteDONE" +>sqliteDONE</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcStr" +>cStr</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcStrLen" +>cStrLen</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AUTF16CString" +>UTF16CString</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AUTF8CString" +>UTF8CString</A +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteOpen" +>sqliteOpen</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteClose" +>sqliteClose</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlitePrepare" +>sqlitePrepare</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteExec" +>sqliteExec</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteCallback" +>SqliteCallback</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteStep" +>sqliteStep</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteFinalise" +>sqliteFinalise</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteReset" +>sqliteReset</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteChanges" +>sqliteChanges</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteFree" +>sqliteFree</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteErrcode" +>sqliteErrcode</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteErrmsg" +>sqliteErrmsg</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteColumnBytes" +>sqliteColumnBytes</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteColumnBlob" +>sqliteColumnBlob</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Blob</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteColumnDouble" +>sqliteColumnDouble</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACDouble" +>CDouble</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteColumnInt" +>sqliteColumnInt</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteColumnInt64" +>sqliteColumnInt64</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACLLong" +>CLLong</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteColumnText" +>sqliteColumnText</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteColumnText16" +>sqliteColumnText16</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF16CString" +>UTF16CString</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteBindBlob" +>sqliteBindBlob</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Blob</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AFreeFunPtr" +>FreeFunPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteBindDouble" +>sqliteBindDouble</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACDouble" +>CDouble</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteBindInt" +>sqliteBindInt</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteBindInt64" +>sqliteBindInt64</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACLLong" +>CLLong</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteBindNull" +>sqliteBindNull</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteBindText" +>sqliteBindText</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AFreeFunPtr" +>FreeFunPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqliteBindText16" +>sqliteBindText16</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF16CString" +>UTF16CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AFreeFunPtr" +>FreeFunPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetError" +>getError</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>SqliteException</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetAndRaiseError" +>getAndRaiseError</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AerrorTest" +>errorTest</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtestForError" +>testForError</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AtestForErrorWithPtr" +>testForErrorWithPtr</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AopenDb" +>openDb</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcloseDb" +>closeDb</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtExec" +>stmtExec</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtChanges" +>stmtChanges</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtPrepare" +>stmtPrepare</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtFetch" +>stmtFetch</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtFinalise" +>stmtFinalise</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AstmtReset" +>stmtReset</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValInt" +>colValInt</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValInt64" +>colValInt64</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValDouble" +>colValDouble</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValString" +>colValString</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcolValBlob" +>colValBlob</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Blob</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindDouble" +>bindDouble</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindInt" +>bindInt</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindInt64" +>bindInt64</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindNull" +>bindNull</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindString" +>bindString</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AbindBlob" +>bindBlob</A +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Blob</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ADBHandleStruct" +></A +><B +>DBHandleStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ADBHandleStruct" +></A +><B +>DBHandleStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ADBHandle" +></A +><B +>DBHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandleStruct" +>DBHandleStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AStmtStruct" +></A +><B +>StmtStruct</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AStmtStruct" +></A +><B +>StmtStruct</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AStmtHandle" +></A +><B +>StmtHandle</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtStruct" +>StmtStruct</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ABlob" +></A +><B +>Blob</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3ASqliteCallback" +></A +><B +>SqliteCallback</B +> a = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AFreeFunPtr" +></A +><B +>FreeFunPtr</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3AFunPtr" +>FunPtr</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Word.html#t%3AWord8" +>Word8</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ())</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ASqliteException" +></A +><B +>SqliteException</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ASqliteException" +></A +><B +>SqliteException</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:SqliteException')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:SqliteException" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>SqliteException</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>SqliteException</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcatchSqlite" +></A +><B +>catchSqlite</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> (<A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>SqliteException</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowSqlite" +></A +><B +>throwSqlite</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>SqliteException</A +> -> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteOK" +></A +><B +>sqliteOK</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteERROR" +></A +><B +>sqliteERROR</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteROW" +></A +><B +>sqliteROW</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteDONE" +></A +><B +>sqliteDONE</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcStr" +></A +><B +>cStr</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcStrLen" +></A +><B +>cStrLen</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACStringLen" +>CStringLen</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AUTF16CString" +></A +><B +>UTF16CString</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t%3AUTF8CString" +></A +><B +>UTF8CString</B +> = <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteOpen" +></A +><B +>sqliteOpen</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteClose" +></A +><B +>sqliteClose</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlitePrepare" +></A +><B +>sqlitePrepare</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteExec" +></A +><B +>sqliteExec</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteCallback" +>SqliteCallback</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-String.html#t%3ACString" +>CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteStep" +></A +><B +>sqliteStep</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteFinalise" +></A +><B +>sqliteFinalise</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteReset" +></A +><B +>sqliteReset</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteChanges" +></A +><B +>sqliteChanges</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteFree" +></A +><B +>sqliteFree</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteErrcode" +></A +><B +>sqliteErrcode</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteErrmsg" +></A +><B +>sqliteErrmsg</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteColumnBytes" +></A +><B +>sqliteColumnBytes</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteColumnBlob" +></A +><B +>sqliteColumnBlob</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Blob</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteColumnDouble" +></A +><B +>sqliteColumnDouble</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACDouble" +>CDouble</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteColumnInt" +></A +><B +>sqliteColumnInt</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteColumnInt64" +></A +><B +>sqliteColumnInt64</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACLLong" +>CLLong</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteColumnText" +></A +><B +>sqliteColumnText</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteColumnText16" +></A +><B +>sqliteColumnText16</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF16CString" +>UTF16CString</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteBindBlob" +></A +><B +>sqliteBindBlob</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Blob</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AFreeFunPtr" +>FreeFunPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteBindDouble" +></A +><B +>sqliteBindDouble</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACDouble" +>CDouble</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteBindInt" +></A +><B +>sqliteBindInt</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteBindInt64" +></A +><B +>sqliteBindInt64</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACLLong" +>CLLong</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteBindNull" +></A +><B +>sqliteBindNull</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteBindText" +></A +><B +>sqliteBindText</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>UTF8CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AFreeFunPtr" +>FreeFunPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqliteBindText16" +></A +><B +>sqliteBindText16</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF16CString" +>UTF16CString</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AFreeFunPtr" +>FreeFunPtr</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetError" +></A +><B +>getError</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>SqliteException</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AgetAndRaiseError" +></A +><B +>getAndRaiseError</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AerrorTest" +></A +><B +>errorTest</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtestForError" +></A +><B +>testForError</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AtestForErrorWithPtr" +></A +><B +>testForErrorWithPtr</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Storable.html#t%3AStorable" +>Storable</A +> a => <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Ptr.html#t%3APtr" +>Ptr</A +> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AopenDb" +></A +><B +>openDb</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcloseDb" +></A +><B +>closeDb</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtExec" +></A +><B +>stmtExec</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>This function is not used internally, so it's only provided + as a user convenience. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtChanges" +></A +><B +>stmtChanges</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtPrepare" +></A +><B +>stmtPrepare</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtFetch" +></A +><B +>stmtFetch</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-C-Types.html#t%3ACInt" +>CInt</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtFinalise" +></A +><B +>stmtFinalise</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AstmtReset" +></A +><B +>stmtReset</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValInt" +></A +><B +>colValInt</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>Column numbers are zero-indexed, so subtract one + from given index (we present a one-indexed interface). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValInt64" +></A +><B +>colValInt64</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValDouble" +></A +><B +>colValDouble</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValString" +></A +><B +>colValString</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcolValBlob" +></A +><B +>colValBlob</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-ForeignPtr.html#t%3AForeignPtr" +>ForeignPtr</A +> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Blob</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindDouble" +></A +><B +>bindDouble</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindInt" +></A +><B +>bindInt</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindInt64" +></A +><B +>bindInt64</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindNull" +></A +><B +>bindNull</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindString" +></A +><B +>bindString</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AbindBlob" +></A +><B +>bindBlob</B +> :: <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>DBHandle</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>StmtHandle</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Blob</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Sqlite-Test-Enumerator.html view
@@ -0,0 +1,124 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Sqlite.Test.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Sqlite.Test.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTest" +></A +><B +>runTest</B +> :: <A HREF="Database-Test-Performance.html#t%3AShouldRunTests" +>ShouldRunTests</A +> -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Sqlite-Test-SqliteFunctions.html view
@@ -0,0 +1,122 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Sqlite.Test.SqliteFunctions</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Sqlite.Test.SqliteFunctions</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTest" +></A +><B +>runTest</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Stub-Enumerator.html view
@@ -0,0 +1,493 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Stub.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Stub.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>Stub implementation of Database.Enumerator. + Useful for people who can't or won't install a DBMS, + so that they can try out the Enumerator interface. +</P +><P +>Currently last last row of any fetch will have a null in its Int columns + (this makes it easier to test handling of nulls and DBUnexpectedNull). + See fetchIntVal. +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ASession" +>Session</A +> </TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AConnParm" +>ConnParm</A +> = <A HREF="#v%3AConnParm" +>ConnParm</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3Auser" +>user</A +>, <A HREF="#v%3Apswd" +>pswd</A +>, <A HREF="#v%3Adbname" +>dbname</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +>}</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aconnect" +>connect</A +> :: <A HREF="Database-Stub-Enumerator.html#t%3AConnParm" +>ConnParm</A +> -> <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Asql" +>sql</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aprefetch" +>prefetch</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AQueryResourceUsage" +>QueryResourceUsage</A +> = <A HREF="#v%3AQueryResourceUsage" +>QueryResourceUsage</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3AprefetchRowCount" +>prefetchRowCount</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +></TABLE +>}</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ASession" +></A +><B +>Session</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Session')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Session" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>ISession</A +> <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryString <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Command</A +> QueryStringTuned <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>IQuery</A +> Query <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> ColumnBuffer</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryString <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Statement</A +> QueryStringTuned <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +> Query</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AConnParm" +></A +><B +>ConnParm</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AConnParm" +></A +><B +>ConnParm</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3Auser" +></A +><B +>user</B +>, <A NAME="v%3Apswd" +></A +><B +>pswd</B +>, <A NAME="v%3Adbname" +></A +><B +>dbname</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aconnect" +></A +><B +>connect</B +> :: <A HREF="Database-Stub-Enumerator.html#t%3AConnParm" +>ConnParm</A +> -> <A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>ConnectA</A +> <A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Session</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Asql" +></A +><B +>sql</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryString</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aprefetch" +></A +><B +>prefetch</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> QueryStringTuned</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AQueryResourceUsage" +></A +><B +>QueryResourceUsage</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>At present the only resource tuning we support is the number of rows + prefetched by the FFI library. + We use a record to (hopefully) make it easy to add other + tuning parameters later. +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AQueryResourceUsage" +></A +><B +>QueryResourceUsage</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AprefetchRowCount" +></A +><B +>prefetchRowCount</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Stub-Test-Enumerator.html view
@@ -0,0 +1,125 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Stub.Test.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Stub.Test.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Simple test harness for Stub. + Stub can't share the tests for "real" backends because it + returns a somewhat contrived result set. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTest" +></A +><B +>runTest</B +> :: a -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Test-Enumerator.html view
@@ -0,0 +1,1002 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Test.Enumerator</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Test.Enumerator</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Simple test harness. Demonstrates possible usage. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t%3ADBLiteralValue" +></A +><B +>DBLiteralValue</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3AliteralDate" +></A +><B +>literalDate</B +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AliteralInt" +></A +><B +>literalInt</B +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AliteralInt64" +></A +><B +>literalInt64</B +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AliteralFloat" +></A +><B +>literalFloat</B +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AFloat" +>Float</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AliteralDouble" +></A +><B +>literalDouble</B +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:DBLiteralValue')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:DBLiteralValue" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-Test-Enumerator.html#t%3ADBLiteralValue" +>DBLiteralValue</A +> <A HREF="Database-Test-Enumerator.html#t%3AOracleFunctions" +>OracleFunctions</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-Test-Enumerator.html#t%3ADBLiteralValue" +>DBLiteralValue</A +> <A HREF="Database-Test-Enumerator.html#t%3APGSqlFunctions" +>PGSqlFunctions</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Database-Test-Enumerator.html#t%3ADBLiteralValue" +>DBLiteralValue</A +> <A HREF="Database-Test-Enumerator.html#t%3ASqliteFunctions" +>SqliteFunctions</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ASqliteFunctions" +></A +><B +>SqliteFunctions</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ASqliteFunctions" +></A +><B +>SqliteFunctions</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:SqliteFunctions')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:SqliteFunctions" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-Test-Enumerator.html#t%3ADBLiteralValue" +>DBLiteralValue</A +> <A HREF="Database-Test-Enumerator.html#t%3ASqliteFunctions" +>SqliteFunctions</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AOracleFunctions" +></A +><B +>OracleFunctions</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3AOracleFunctions" +></A +><B +>OracleFunctions</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:OracleFunctions')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:OracleFunctions" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-Test-Enumerator.html#t%3ADBLiteralValue" +>DBLiteralValue</A +> <A HREF="Database-Test-Enumerator.html#t%3AOracleFunctions" +>OracleFunctions</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3APGSqlFunctions" +></A +><B +>PGSqlFunctions</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3APGSqlFunctions" +></A +><B +>PGSqlFunctions</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:PGSqlFunctions')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:PGSqlFunctions" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-Test-Enumerator.html#t%3ADBLiteralValue" +>DBLiteralValue</A +> <A HREF="Database-Test-Enumerator.html#t%3APGSqlFunctions" +>PGSqlFunctions</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdateSqlite" +></A +><B +>dateSqlite</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdateOracle" +></A +><B +>dateOracle</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdatePG" +></A +><B +>datePG</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexpectFloatsAndInts" +></A +><B +>expectFloatsAndInts</B +> :: [(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterNullString" +></A +><B +>iterNullString</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterEmptyString" +></A +><B +>iterEmptyString</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterUnhandledNull" +></A +><B +>iterUnhandledNull</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> UTCTime -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, UTCTime)]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterNullDate" +></A +><B +>iterNullDate</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> UTCTime -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>, UTCTime)]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterDate" +></A +><B +>iterDate</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => UTCTime -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [UTCTime]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterCalDate" +></A +><B +>iterCalDate</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterBoundaryDates" +></A +><B +>iterBoundaryDates</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => UTCTime -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [UTCTime]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterCursor" +></A +><B +>iterCursor</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterBindString" +></A +><B +>iterBindString</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterBindInt" +></A +><B +>iterBindInt</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexpectBindInt" +></A +><B +>expectBindInt</B +> :: [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterBindIntDoubleString" +></A +><B +>iterBindIntDoubleString</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexpectBindIntDoubleString" +></A +><B +>expectBindIntDoubleString</B +> :: [(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterBindDate" +></A +><B +>iterBindDate</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => UTCTime -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m [UTCTime]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AMyTree" +></A +><B +>MyTree</B +> a</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ALeaf" +></A +><B +>Leaf</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ABranch" +></A +><B +>Branch</B +> [<A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> a]</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:MyTree')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:MyTree" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +>(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Eq.html#t%3AEq" +>Eq</A +> a, ??? a) => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Eq.html#t%3AEq" +>Eq</A +> (<A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> a)</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Read.html#t%3ARead" +>Read</A +> a, ??? a) => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Read.html#t%3ARead" +>Read</A +> (<A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> a)</TD +></TR +><TR +><TD CLASS="decl" +>(<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a, ??? a) => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> (<A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> a)</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterPolymorphicFetch" +></A +><B +>iterPolymorphicFetch</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m (<A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AiterPolymorphicFetchNull" +></A +><B +>iterPolymorphicFetchNull</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>) -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>))</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexpectPolymorphicFetchNull" +></A +><B +>expectPolymorphicFetchNull</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>MyTree</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexpectRebind1" +></A +><B +>expectRebind1</B +> :: [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AexpectRebind2" +></A +><B +>expectRebind2</B +> :: [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Test-MultiConnect.html view
@@ -0,0 +1,127 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Test.MultiConnect</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Test.MultiConnect</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Tests Database.Enumerator code in the context of multiple + database connections to different DBMS products. + We should add tests to shift data between databases, too. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTest" +></A +><B +>runTest</B +> :: <A HREF="Database-Test-Performance.html#t%3AShouldRunTests" +>ShouldRunTests</A +> -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>] -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Test-Performance.html view
@@ -0,0 +1,339 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Test.Performance</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Test.Performance</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Performance tests. Currently just tests large result sets. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AShouldRunTests" +>ShouldRunTests</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ARunTests" +>RunTests</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ADon%27tRunTests" +>Don'tRunTests</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ArowCounter" +>rowCounter</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlRows2Power17" +>sqlRows2Power17</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsqlRows2Power20" +>sqlRows2Power20</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3AShouldRunTests" +></A +><B +>ShouldRunTests</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ARunTests" +></A +><B +>RunTests</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ADon%27tRunTests" +></A +><B +>Don'tRunTests</B +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:ShouldRunTests')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:ShouldRunTests" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Eq.html#t%3AEq" +>Eq</A +> <A HREF="Database-Test-Performance.html#t%3AShouldRunTests" +>ShouldRunTests</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Database-Test-Performance.html#t%3AShouldRunTests" +>ShouldRunTests</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArowCounter" +></A +><B +>rowCounter</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#t%3AMonad" +>Monad</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +> -> <A HREF="Database-Enumerator.html#t%3AIterAct" +>IterAct</A +> m <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>This counter takes the maximum number of rows to fetch as its first argument, + so don't forget to curry it when using it as an iteratee function. + We also try to ensure that it is strict in the counter; + we don't want thousands or millions of unevaluated <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3A%2B" +>+</A +></TT +> thunks sitting + on the stack. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlRows2Power17" +></A +><B +>sqlRows2Power17</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AsqlRows2Power20" +></A +><B +>sqlRows2Power20</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Database-Util.html view
@@ -0,0 +1,796 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Database.Util</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Database.Util</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>Utility functions. Mostly used in database back-ends, and tests. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="#t%3AMyShow" +>MyShow</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3Ashow_" +>show_</A +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aprint_" +>print_</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO" +>MonadIO</A +> m, <A HREF="Database-Util.html#t%3AMyShow" +>MyShow</A +> a) => a -> m ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkUTCTime" +>mkUTCTime</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AReal" +>Real</A +> b) => a -> a -> a -> a -> a -> b -> UTCTime</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AmkCalTime" +>mkCalTime</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a => a -> a -> a -> a -> a -> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aint64ToDateParts" +>int64ToDateParts</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdatePartsToInt64" +>datePartsToInt64</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a1, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a2, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a3, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a4, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a5, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a6) => (a1, a2, a3, a4, a5, a6) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcalTimeToInt64" +>calTimeToInt64</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aint64ToCalTime" +>int64ToCalTime</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aint64ToUTCTime" +>int64ToUTCTime</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> UTCTime</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwordsBy" +>wordsBy</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +>) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AskipNonMatch" +>skipNonMatch</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +>) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Apositions" +>positions</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Eq.html#t%3AEq" +>Eq</A +> a => [a] -> [a] -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApgDatetimetoUTCTime" +>pgDatetimetoUTCTime</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> UTCTime</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApgDatetimetoCalTime" +>pgDatetimetoCalTime</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ApgDatetimetoParts" +>pgDatetimetoParts</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AutcTimeToPGDatetime" +>utcTimeToPGDatetime</A +> :: UTCTime -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AcalTimeToPGDatetime" +>calTimeToPGDatetime</A +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A NAME="t%3AMyShow" +></A +><B +>MyShow</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v%3Ashow_" +></A +><B +>show_</B +> :: a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:MyShow')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:MyShow" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Database-Util.html#t%3AMyShow" +>MyShow</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a => <A HREF="Database-Util.html#t%3AMyShow" +>MyShow</A +> a</TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aprint_" +></A +><B +>print_</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-Trans.html#t%3AMonadIO" +>MonadIO</A +> m, <A HREF="Database-Util.html#t%3AMyShow" +>MyShow</A +> a) => a -> m ()</TD +></TR +><TR +><TD CLASS="doc" +>Like <TT +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#v%3Aprint" +>print</A +></TT +>, except that Strings are not escaped or quoted. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkUTCTime" +></A +><B +>mkUTCTime</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AReal" +>Real</A +> b) => a -> a -> a -> a -> a -> b -> UTCTime</TD +></TR +><TR +><TD CLASS="doc" +>Convenience for making UTCTimes. Assumes the time given is already UTC time + i.e. there's no timezone adjustment. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AmkCalTime" +></A +><B +>mkCalTime</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a => a -> a -> a -> a -> a -> a -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aint64ToDateParts" +></A +><B +>int64ToDateParts</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AdatePartsToInt64" +></A +><B +>datePartsToInt64</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a1, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a2, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a3, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a4, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a5, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3AIntegral" +>Integral</A +> a6) => (a1, a2, a3, a4, a5, a6) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcalTimeToInt64" +></A +><B +>calTimeToInt64</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aint64ToCalTime" +></A +><B +>int64ToCalTime</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Aint64ToUTCTime" +></A +><B +>int64ToUTCTime</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt64" +>Int64</A +> -> UTCTime</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AwordsBy" +></A +><B +>wordsBy</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +>) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AskipNonMatch" +></A +><B +>skipNonMatch</B +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AChar" +>Char</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +>) -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Apositions" +></A +><B +>positions</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Eq.html#t%3AEq" +>Eq</A +> a => [a] -> [a] -> [<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApgDatetimetoUTCTime" +></A +><B +>pgDatetimetoUTCTime</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> UTCTime</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApgDatetimetoCalTime" +></A +><B +>pgDatetimetoCalTime</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ApgDatetimetoParts" +></A +><B +>pgDatetimetoParts</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t%3ADouble" +>Double</A +>, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AutcTimeToPGDatetime" +></A +><B +>utcTimeToPGDatetime</B +> :: UTCTime -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AcalTimeToPGDatetime" +></A +><B +>calTimeToPGDatetime</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Time.html#t%3ACalendarTime" +>CalendarTime</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="doc" +>Assumes CalendarTime is also UTC i.e. ignores ctTZ component. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Main.html view
@@ -0,0 +1,142 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Main</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Main</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>non-portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>Simple driver module, mainly for testing. + Imports test modules and runs test suites. +</P +><P +>This project is now hosted at haskell.org: +</P +><PRE +>darcs get <A HREF="http://darcs.haskell.org/takusen" +>http://darcs.haskell.org/takusen</A +></PRE +><P +>Invoke main like this (assuming the compiled executable is called <TT +>takusen</TT +>): +</P +><PRE +> takusen stub noperf + takusen sqlite noperf "" "" dbname + takusen oracle noperf "" "" dbname -- no username, so os-authenticated + takusen mssql noperf user paswd dbname +</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Amain" +></A +><B +>main</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Test-MiniUnit.html view
@@ -0,0 +1,601 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Test.MiniUnit</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Test.MiniUnit</FONT +></TD +><TD ALIGN="right" +><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="infohead" +>Portability</TD +><TD CLASS="infoval" +>portable</TD +></TR +><TR +><TD CLASS="infohead" +>Stability</TD +><TD CLASS="infoval" +>experimental</TD +></TR +><TR +><TD CLASS="infohead" +>Maintainer</TD +><TD CLASS="infoval" +>oleg@pobox.com, alistair@abayley.org</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +><B +>Contents</B +></TD +></TR +><TR +><TD +><DL +><DT +><A HREF="#1" +>Primary API +</A +></DT +><DT +><A HREF="#2" +>Exposed for self-testing only; see <A HREF="Test-MiniUnitTest.html" +>Test.MiniUnitTest</A +> +</A +></DT +></DL +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>This is just a simple one-module unit test framework, with the same + API as <A HREF="Test-HUnit.html" +>Test.HUnit</A +> (albeit with a lot of stuff missing). + We use it because it works in <TT +><A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +></TT +> + instead of IO + (and also because I couldn't convert <A HREF="Test-HUnit.html" +>Test.HUnit</A +> + to use <TT +><A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +></TT +>). +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3ArunTestTT" +>runTestTT</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [m ()] -> m <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AassertFailure" +>assertFailure</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AassertBool" +>assertBool</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AassertString" +>assertString</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AassertEqual" +>assertEqual</A +> :: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Eq.html#t%3AEq" +>Eq</A +> a, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m) => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> a -> a -> m ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3ATestResult" +>TestResult</A +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ATestSuccess" +>TestSuccess</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ATestFailure" +>TestFailure</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3ATestException" +>TestException</A +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AthrowUserError" +>throwUserError</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3ArunSingleTest" +>runSingleTest</A +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => m () -> m <A HREF="Test-MiniUnit.html#t%3ATestResult" +>TestResult</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="1" +>Primary API +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunTestTT" +></A +><B +>runTestTT</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> [m ()] -> m <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt" +>Int</A +></TD +></TR +><TR +><TD CLASS="doc" +>Return 0 if everything is rosy, + 1 if there were assertion failures (but no exceptions), + 2 if there were any exceptions. + You could use this return code as the return code from + your program, if you're driving from the command line. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AassertFailure" +></A +><B +>assertFailure</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AassertBool" +></A +><B +>assertBool</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Bool.html#t%3ABool" +>Bool</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AassertString" +></A +><B +>assertString</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AassertEqual" +></A +><B +>assertEqual</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: (<A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Eq.html#t%3AEq" +>Eq</A +> a, <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> a, <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m)</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>message preface +</TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>expected +</TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>actual +</TD +></TR +><TR +><TD CLASS="arg" +>-> m ()</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section2" +><A NAME="2" +>Exposed for self-testing only; see <A HREF="Test-MiniUnitTest.html" +>Test.MiniUnitTest</A +> +</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t%3ATestResult" +></A +><B +>TestResult</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v%3ATestSuccess" +></A +><B +>TestSuccess</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ATestFailure" +></A +><B +>TestFailure</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v%3ATestException" +></A +><B +>TestException</B +> <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:TestResult')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:TestResult" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Eq.html#t%3AEq" +>Eq</A +> <A HREF="Test-MiniUnit.html#t%3ATestResult" +>TestResult</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Test-MiniUnit.html#t%3ATestResult" +>TestResult</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3AthrowUserError" +></A +><B +>throwUserError</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> m ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3ArunSingleTest" +></A +><B +>runSingleTest</B +> :: <A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>CaughtMonadIO</A +> m => m () -> m <A HREF="Test-MiniUnit.html#t%3ATestResult" +>TestResult</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/Test-MiniUnitTest.html view
@@ -0,0 +1,90 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Test.MiniUnitTest</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Test.MiniUnitTest</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v%3Amain" +></A +><B +>main</B +> :: <A HREF="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO" +>IO</A +> ()</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-A.html view
@@ -0,0 +1,178 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (A)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>allocBufferFor</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AallocBufferFor" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>assertBool</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3AassertBool" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>assertEqual</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3AassertEqual" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>assertFailure</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3AassertFailure" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>assertString</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3AassertString" +>Test.MiniUnit</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-B.html view
@@ -0,0 +1,472 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (B)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" COLSPAN="2" +>BindA</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ABindA" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3ABindA" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>BindBuffer</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ABindBuffer" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>BindHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ABindHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>BindStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ABindStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3ABindStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>Blob</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3ABlob" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>Branch</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3ABranch" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>BufferFPtr</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferFPtr" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>BufferPtr</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ABufferPtr" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>basicDBExceptionReporter</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AbasicDBExceptionReporter" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>beginTrans</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbeginTrans" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>beginTransaction</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AbeginTransaction" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AbeginTransaction" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindBlob</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AbindBlob" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindByPos</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbindByPos" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindDouble</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AbindDouble" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AbindInt" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindInt64</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AbindInt64" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AbindNull" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindOutputByPos</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbindOutputByPos" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindP</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AbindP" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3AbindP" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>bindRun</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AbindRun" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AbindString" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindType</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AbindType" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindValFormat</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AbindValFormat" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindValOid</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AbindValOid" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindValPtr</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AbindValPtr" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bindValSize</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AbindValSize" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferPeekValue</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferPeekValue" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToA</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToA" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToCDouble</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToCDouble" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToCInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToCInt" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToCaltime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToCaltime" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToDouble</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToDouble" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToInt" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToStmtHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToStmtHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToString" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>bufferToUTCTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbufferToUTCTime" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>byteToInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AbyteToInt" +>Database.Oracle.OCIFunctions</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-C.html view
@@ -0,0 +1,804 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (C)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>CAconnect_timeout</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAconnect_timeout" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CAdbname</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAdbname" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CAhost</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAhost" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CAhostaddr</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAhostaddr" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CAoptions</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAoptions" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CApassword</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACApassword" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CAport</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAport" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CAservice</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAservice" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CAsslmode</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAsslmode" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CAuser</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ACAuser" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>CaughtMonadIO</TD +><TD CLASS="indexlinks" +><A HREF="Control-Exception-MonadIO.html#t%3ACaughtMonadIO" +>Control.Exception.MonadIO</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ColNum</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3AColNum" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ColumnInfo</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AColumnInfo" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ColumnResultBuffer</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AColumnResultBuffer" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>Command</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ACommand" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ConnHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AConnHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>ConnParm</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#t%3AConnParm" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3AConnParm" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ConnStatusType</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3AConnStatusType" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>ConnStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AConnStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AConnStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>ConnectA</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3AConnectA" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AConnectA" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ConnectAttr</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#t%3AConnectAttr" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>Context</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AContext" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AContext" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ContextPtr</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AContextPtr" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>cShort2Int</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AcShort2Int" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>cStr</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AcStr" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcStr" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcStr" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>cStrLen</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AcStrLen" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcStrLen" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcStrLen" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>cUShort2Int</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AcUShort2Int" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>calTimeToBuffer</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AcalTimeToBuffer" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>calTimeToInt64</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AcalTimeToInt64" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>calTimeToPGDatetime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AcalTimeToPGDatetime" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>catchDB</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AcatchDB" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>catchDBError</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AcatchDBError" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>catchOCI</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AcatchOCI" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>catchPG</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcatchPG" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>catchSqlite</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcatchSqlite" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>check'stmt</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3Acheck%27stmt" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>closeDb</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcloseDb" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcloseDb" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>cmdbind</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3Acmdbind" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3Acmdbind" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3Acmdbind" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>colVal</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolVal" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>colValBlob</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcolValBlob" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>colValCalTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValCalTime" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>colValDouble</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValDouble" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcolValDouble" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>colValFloat</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValFloat" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>colValInt</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValInt" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcolValInt" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>colValInt64</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValInt64" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcolValInt64" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>colValNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValNull" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>colValPtr</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValPtr" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>colValString</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValString" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AcolValString" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>colValUTCTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AcolValUTCTime" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>commit</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3Acommit" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3Acommit" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>commitTrans</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AcommitTrans" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>connect</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3Aconnect" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3Aconnect" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3Aconnect" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3Aconnect" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>cuCharToInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AcuCharToInt" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>currentRowNum</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AcurrentRowNum" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3AcurrentRowNum" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>cursorCurrent</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AcursorCurrent" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>cursorIsEOF</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AcursorIsEOF" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>cursorNext</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AcursorNext" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-D.html view
@@ -0,0 +1,408 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (D)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>DBBind</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ADBBind" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>DBError</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3ADBError" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3ADBError" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>DBException</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ADBException" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#t%3ADBException" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>DBFatal</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3ADBFatal" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3ADBFatal" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>DBHandle</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandle" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandle" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>DBHandleStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3ADBHandleStruct" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3ADBHandleStruct" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3ADBHandleStruct" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>DBLiteralValue</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#t%3ADBLiteralValue" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>DBM</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#t%3ADBM" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>DBNoData</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3ADBNoData" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3ADBNoData" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>DBType</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ADBType" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>DBUnexpectedNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3ADBUnexpectedNull" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3ADBUnexpectedNull" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>DefnHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ADefnHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>DefnStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ADefnStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3ADefnStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>Don'tRunTests</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Performance.html#v%3ADon%27tRunTests" +>Database.Test.Performance</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>dateOracle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AdateOracle" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>datePG</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AdatePG" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>datePartsToInt64</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AdatePartsToInt64" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>dateSqlite</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AdateSqlite" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>dbLogoff</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AdbLogoff" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>dbLogon</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AdbLogon" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>dbname</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3Adbname" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>defineByPos</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AdefineByPos" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>destroyQuery</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AdestroyQuery" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>destroyStmt</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AdestroyStmt" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>disconnect</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3Adisconnect" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>doQuery</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AdoQuery" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>dumpBuffer</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AdumpBuffer" +>Database.Oracle.OCIFunctions</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-E.html view
@@ -0,0 +1,314 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (E)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>EnvHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>EnvStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AEnvStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AEnvStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ErrorHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>ErrorStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AErrorStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AErrorStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ExecStatusType</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3AExecStatusType" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>envCreate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AenvCreate" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>errorTest</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AerrorTest" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>execCommand</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AexecCommand" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>execDDL</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AexecDDL" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>execDML</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AexecDML" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>execPrepared</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AexecPrepared" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>execPreparedCommand</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AexecPreparedCommand" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>executeCommand</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AexecuteCommand" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>expectBindInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AexpectBindInt" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>expectBindIntDoubleString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AexpectBindIntDoubleString" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>expectFloatsAndInts</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AexpectFloatsAndInts" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>expectPolymorphicFetchNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AexpectPolymorphicFetchNull" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>expectRebind1</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AexpectRebind1" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>expectRebind2</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AexpectRebind2" +>Database.Test.Enumerator</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-F.html view
@@ -0,0 +1,498 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (F)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>Format</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3AFormat" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>FreeFunPtr</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3AFreeFunPtr" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQclear</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQclear" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQcmdStatus</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQcmdStatus" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQcmdTuples</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQcmdTuples" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQconnectdb</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQconnectdb" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQdb</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQdb" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQerrorMessage</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQerrorMessage" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQexecParams</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQexecParams" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQexecPrepared</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQexecPrepared" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQfformat</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQfformat" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQfinish</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQfinish" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQfname</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQfname" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQftype</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQftype" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQgetResult</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQgetResult" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQgetisnull</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQgetisnull" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQgetlength</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQgetlength" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQgetvalue</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQgetvalue" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQnfields</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQnfields" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQntuples</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQntuples" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQoidValue</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQoidValue" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQprepare</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQprepare" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQputCopyData</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQputCopyData" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQputCopyEnd</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQputCopyEnd" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQreset</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQreset" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQresultErrorMessage</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQresultErrorMessage" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQresultStatus</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQresultStatus" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQsetClientEncoding</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQsetClientEncoding" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQsetErrorVerbosity</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQsetErrorVerbosity" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQsetNoticeProcessor</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQsetNoticeProcessor" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQsetNoticeReceiver</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQsetNoticeReceiver" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fPQstatus</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfPQstatus" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fetchCol</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AfetchCol" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fetchOneRow</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AfetchOneRow" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>formatDBException</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AformatDBException" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>formatEnvMsg</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatEnvMsg" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>formatErrorCodeDesc</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatErrorCodeDesc" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>formatErrorMsg</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatErrorMsg" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>formatMsgCommon</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatMsgCommon" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>formatOCIMsg</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AformatOCIMsg" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>freeBuffer</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AfreeBuffer" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fromCChar</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AfromCChar" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fromEnumOCIErrorCode</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AfromEnumOCIErrorCode" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fromUTF8</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3AfromUTF8" +>Foreign.C.UTF8</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>fromUTF8String</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3AfromUTF8String" +>Foreign.C.UTF8</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-G.html view
@@ -0,0 +1,254 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (G)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>gbracket</TD +><TD CLASS="indexlinks" +><A HREF="Control-Exception-MonadIO.html#v%3Agbracket" +>Control.Exception.MonadIO</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>gcatch</TD +><TD CLASS="indexlinks" +><A HREF="Control-Exception-MonadIO.html#v%3Agcatch" +>Control.Exception.MonadIO</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>gcatchJust</TD +><TD CLASS="indexlinks" +><A HREF="Control-Exception-MonadIO.html#v%3AgcatchJust" +>Control.Exception.MonadIO</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>getAndRaiseError</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AgetAndRaiseError" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>getError</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AgetError" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AgetError" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>getHandleAttr</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AgetHandleAttr" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>getOCIErrorMsg</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AgetOCIErrorMsg" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>getOCIErrorMsg2</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AgetOCIErrorMsg2" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>getParam</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AgetParam" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>getSession</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AgetSession" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>gfinally</TD +><TD CLASS="indexlinks" +><A HREF="Control-Exception-MonadIO.html#v%3Agfinally" +>Control.Exception.MonadIO</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>gtry</TD +><TD CLASS="indexlinks" +><A HREF="Control-Exception-MonadIO.html#v%3Agtry" +>Control.Exception.MonadIO</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>gtryJust</TD +><TD CLASS="indexlinks" +><A HREF="Control-Exception-MonadIO.html#v%3AgtryJust" +>Control.Exception.MonadIO</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-H.html view
@@ -0,0 +1,154 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (H)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>handleAlloc</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AhandleAlloc" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>handleFree</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AhandleFree" +>Database.Oracle.OCIFunctions</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-I.html view
@@ -0,0 +1,340 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (I)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>IPrepared</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3AIPrepared" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>IQuery</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3AIQuery" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ISession</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3AISession" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>IsolationLevel</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3AIsolationLevel" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#t%3AIsolationLevel" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>IterAct</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#t%3AIterAct" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>IterResult</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#t%3AIterResult" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>ifNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AifNull" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>ignoreDBError</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AignoreDBError" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>int64ToCalTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3Aint64ToCalTime" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>int64ToDateParts</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3Aint64ToDateParts" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>int64ToUTCTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3Aint64ToUTCTime" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterBindDate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterBindDate" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterBindInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterBindInt" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterBindIntDoubleString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterBindIntDoubleString" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterBindString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterBindString" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterBoundaryDates</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterBoundaryDates" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterCalDate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterCalDate" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterCursor</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterCursor" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterDate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterDate" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterEmptyString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterEmptyString" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterNullDate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterNullDate" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterNullString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterNullString" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterPolymorphicFetch</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterPolymorphicFetch" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterPolymorphicFetchNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterPolymorphicFetchNull" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>iterUnhandledNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AiterUnhandledNull" +>Database.Test.Enumerator</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-L.html view
@@ -0,0 +1,194 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (L)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>Leaf</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3ALeaf" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>lengthUTF8</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3AlengthUTF8" +>Foreign.C.UTF8</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>literalDate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AliteralDate" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>literalDouble</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AliteralDouble" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>literalFloat</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AliteralFloat" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>literalInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AliteralInt" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>literalInt64</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AliteralInt64" +>Database.Test.Enumerator</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-M.html view
@@ -0,0 +1,286 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (M)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>MyShow</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#t%3AMyShow" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>MyTree</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#t%3AMyTree" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>main</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Main.html#v%3Amain" +>Main</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnitTest.html#v%3Amain" +>Test.MiniUnitTest</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>makeCentByte</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmakeCentByte" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>makeQuery</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AmakeQuery" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>makeYear</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmakeYear" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>makeYearByte</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmakeYearByte" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>maybeBufferNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmaybeBufferNull" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkCInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmkCInt" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkCShort</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmkCShort" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkCUShort</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmkCUShort" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkCalTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AmkCalTime" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkNoticeProcessor</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AmkNoticeProcessor" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkNoticeReceiver</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AmkNoticeReceiver" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkOCICallbackInBind</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmkOCICallbackInBind" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkOCICallbackOutBind</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AmkOCICallbackOutBind" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>mkUTCTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AmkUTCTime" +>Database.Util</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-N.html view
@@ -0,0 +1,214 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (N)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" COLSPAN="2" +>NextResultSet</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#t%3ANextResultSet" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3ANextResultSet" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>NoticeProcessor</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeProcessor" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>NoticeReceiver</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3ANoticeReceiver" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>newUTF8String</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3AnewUTF8String" +>Foreign.C.UTF8</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>nqCopyIn</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AnqCopyIn" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>nqCopyIn_buflen</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AnqCopyIn_buflen" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>nqExec</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AnqExec" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>nullByte</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AnullByte" +>Database.Oracle.OCIFunctions</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-O.html view
@@ -0,0 +1,746 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (O)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" COLSPAN="2" +>OCIBuffer</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIBuffer" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AOCIBuffer" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>OCICallbackInBind</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackInBind" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>OCICallbackOutBind</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCICallbackOutBind" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>OCIException</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIException" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AOCIException" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>OCIHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>OCIStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AOCIStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AOCIStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>Oid</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3AOid" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>OracleFunctions</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#t%3AOracleFunctions" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3AOracleFunctions" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>Out</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#t%3AOut" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3AOut" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociAttrGet</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociAttrGet" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociAttrSet</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociAttrSet" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociBindByPos</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociBindByPos" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociBindDynamic</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociBindDynamic" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociDefineByPos</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociDefineByPos" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociEnvCreate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociEnvCreate" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociErrorGet</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociErrorGet" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociHandleAlloc</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociHandleAlloc" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociHandleFree</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociHandleFree" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociLogoff</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociLogoff" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociLogon</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociLogon" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociParamGet</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociParamGet" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociServerAttach</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociServerAttach" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociServerDetach</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociServerDetach" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociSessionBegin</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociSessionBegin" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociSessionEnd</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociSessionEnd" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociStmtExecute</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociStmtExecute" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociStmtFetch</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociStmtFetch" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociStmtPrepare</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociStmtPrepare" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociTerminate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociTerminate" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociTransCommit</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociTransCommit" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociTransRollback</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociTransRollback" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ociTransStart</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AociTransStart" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_CRED_EXT</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_CRED_EXT" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_CRED_PROXY</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_CRED_PROXY" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_CRED_RDBMS</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_CRED_RDBMS" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_DEFAULT</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_DEFAULT" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_FETCH_ABSOLUTE</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_FETCH_ABSOLUTE" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_FETCH_FIRST</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_FETCH_FIRST" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_FETCH_LAST</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_FETCH_LAST" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_FETCH_NEXT</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_FETCH_NEXT" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_FETCH_PRIOR</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_FETCH_PRIOR" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_FETCH_RELATIVE</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_FETCH_RELATIVE" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_FETCH_RESERVED</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_FETCH_RESERVED" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_NTV_SYNTAX</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_NTV_SYNTAX" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_AFC</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_AFC" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_AVC</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_AVC" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_BIN</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_BIN" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_CHR</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_CHR" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_DAT</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_DAT" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_FLT</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_FLT" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_INT</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_INT" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_LBI</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_LBI" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_LNG</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_LNG" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_LVB</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_LVB" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_LVC</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_LVC" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_NUM</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_NUM" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_RID</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_RID" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_RSET</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_RSET" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_STR</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_STR" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_UIN</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_UIN" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_VBI</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_VBI" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_VCS</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_VCS" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_SQLT_VNU</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_SQLT_VNU" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_TRANS_READONLY</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_TRANS_READONLY" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_TRANS_READWRITE</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_TRANS_READWRITE" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>oci_TRANS_SERIALIZABLE</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIConstants.html#v%3Aoci_TRANS_SERIALIZABLE" +>Database.Oracle.OCIConstants</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>openDb</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AopenDb" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AopenDb" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-P.html view
@@ -0,0 +1,610 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (P)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" COLSPAN="2" +>PGBindVal</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGBindVal" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3APGBindVal" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>PGException</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGException" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3APGException" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>PGSqlFunctions</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#t%3APGSqlFunctions" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3APGSqlFunctions" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>PGType</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGType" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>PGVerbosity</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3APGVerbosity" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>PGconn</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3APGconn" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>PGresult</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3APGresult" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ParamHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AParamHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ParamLen</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3AParamLen" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>ParamStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AParamStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AParamStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>Position</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3APosition" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>PreparationA</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3APreparationA" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3APreparationA" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>PreparedStmt</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#t%3APreparedStmt" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3APreparedStmt" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>peekUTF8String</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3ApeekUTF8String" +>Foreign.C.UTF8</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pgDatetimetoCalTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3ApgDatetimetoCalTime" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pgDatetimetoParts</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3ApgDatetimetoParts" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pgDatetimetoUTCTime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3ApgDatetimetoUTCTime" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pgNewValue</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3ApgNewValue" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pgPeek</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3ApgPeek" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pgSize</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3ApgSize" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pgTypeFormat</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3ApgTypeFormat" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pgTypeOid</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3ApgTypeOid" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>positions</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3Apositions" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>prefetch</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3Aprefetch" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3Aprefetch" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3Aprefetch" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3Aprefetch" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>prefetchRowCount</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3AprefetchRowCount" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>prepare'n'exec</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3Aprepare%27n%27exec" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>prepareCommand</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3AprepareCommand" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AprepareCommand" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3AprepareCommand" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>prepareLargeCommand</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3AprepareLargeCommand" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>prepareLargeQuery</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3AprepareLargeQuery" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AprepareLargeQuery" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3AprepareLargeQuery" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>preparePrefetch</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3ApreparePrefetch" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3ApreparePrefetch" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3ApreparePrefetch" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>prepareQuery</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3AprepareQuery" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AprepareQuery" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3AprepareQuery" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>prepareStmt</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3AprepareStmt" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3AprepareStmt" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3AprepareStmt" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>print_</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3Aprint_" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>pswd</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3Apswd" +>Database.Stub.Enumerator</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-Q.html view
@@ -0,0 +1,158 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (Q)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" COLSPAN="2" +>QueryResourceUsage</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#t%3AQueryResourceUsage" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3AQueryResourceUsage" +>Database.Stub.Enumerator</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-R.html view
@@ -0,0 +1,380 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (R)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>ReadCommitted</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AReadCommitted" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3AReadCommitted" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>ReadUncommitted</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AReadUncommitted" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3AReadUncommitted" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>RefCursor</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#t%3ARefCursor" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3ARefCursor" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>RepeatableRead</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3ARepeatableRead" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3ARepeatableRead" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>ResultSetHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3AResultSetHandle" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>RowNum</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ARowNum" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>RunTests</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Performance.html#v%3ARunTests" +>Database.Test.Performance</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>reportResults</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3AreportResults" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>reportRethrow</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AreportRethrow" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>result</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3Aresult" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>result'</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3Aresult%27" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>rethrowPG</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3ArethrowPG" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>rollback</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3Arollback" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3Arollback" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>rollbackTrans</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3ArollbackTrans" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>rowCounter</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Performance.html#v%3ArowCounter" +>Database.Test.Performance</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>runSingleTest</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3ArunSingleTest" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>runTest</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Test-Enumerator.html#v%3ArunTest" +>Database.Oracle.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Test-OCIFunctions.html#v%3ArunTest" +>Database.Oracle.Test.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Test-Enumerator.html#v%3ArunTest" +>Database.PostgreSQL.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Test-PGFunctions.html#v%3ArunTest" +>Database.PostgreSQL.Test.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>5 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Test-Enumerator.html#v%3ArunTest" +>Database.Sqlite.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>6 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Test-SqliteFunctions.html#v%3ArunTest" +>Database.Sqlite.Test.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>7 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Test-Enumerator.html#v%3ArunTest" +>Database.Stub.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>8 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-MultiConnect.html#v%3ArunTest" +>Database.Test.MultiConnect</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>9 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Util.html#v%3ArunTest" +>Database.Test.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>runTestTT</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3ArunTestTT" +>Test.MiniUnit</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-S.html view
@@ -0,0 +1,952 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (S)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>Serialisable</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3ASerialisable" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3ASerialisable" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>Serializable</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3ASerializable" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3ASerializable" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>ServerHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AServerHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>ServerStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AServerStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AServerStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>SessHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ASessHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>SessStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3ASessStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3ASessStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>Session</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#t%3ASession" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#t%3ASession" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#t%3ASession" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>4 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#t%3ASession" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>ShouldRunTests</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Performance.html#t%3AShouldRunTests" +>Database.Test.Performance</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>SqlState</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ASqlState" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>SqlStateClass</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ASqlStateClass" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>SqlStateSubClass</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3ASqlStateSubClass" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>SqliteCallback</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteCallback" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>SqliteException</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3ASqliteException" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3ASqliteException" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>SqliteFunctions</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#t%3ASqliteFunctions" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Enumerator.html#v%3ASqliteFunctions" +>Database.Test.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>Statement</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#t%3AStatement" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>StmtHandle</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtHandle" +>Database.Oracle.OCIFunctions</A +>, <A HREF="Database-Oracle-Enumerator.html#t%3AStmtHandle" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtHandle" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>StmtStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AStmtStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AStmtStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3AStmtStruct" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>4 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3AStmtStruct" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>5 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AStmtStruct" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>sbph</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3Asbph" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3Asbph" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>serverAttach</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AserverAttach" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>serverDetach</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AserverDetach" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sessionBegin</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AsessionBegin" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sessionEnd</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AsessionEnd" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>setBufferByte</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AsetBufferByte" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>setHandleAttr</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AsetHandleAttr" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>setHandleAttrString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AsetHandleAttrString" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>show_</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3Ashow_" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>skipNonMatch</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AskipNonMatch" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>sql</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3Asql" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3Asql" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3Asql" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3Asql" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqlRows2Power17</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Performance.html#v%3AsqlRows2Power17" +>Database.Test.Performance</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqlRows2Power20</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Performance.html#v%3AsqlRows2Power20" +>Database.Test.Performance</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>sqlbind</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-Enumerator.html#v%3Asqlbind" +>Database.Oracle.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-Enumerator.html#v%3Asqlbind" +>Database.PostgreSQL.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-Enumerator.html#v%3Asqlbind" +>Database.Sqlite.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteBindBlob</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteBindBlob" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteBindDouble</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteBindDouble" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteBindInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteBindInt" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteBindInt64</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteBindInt64" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteBindNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteBindNull" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteBindText</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteBindText" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteBindText16</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteBindText16" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteChanges</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteChanges" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteClose</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteClose" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteColumnBlob</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteColumnBlob" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteColumnBytes</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteColumnBytes" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteColumnDouble</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteColumnDouble" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteColumnInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteColumnInt" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteColumnInt64</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteColumnInt64" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteColumnText</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteColumnText" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteColumnText16</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteColumnText16" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteDONE</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteDONE" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteERROR</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteERROR" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteErrcode</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteErrcode" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteErrmsg</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteErrmsg" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteExec</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteExec" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteFinalise</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteFinalise" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteFree</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteFree" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteOK</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteOK" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteOpen</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteOpen" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqlitePrepare</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqlitePrepare" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteROW</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteROW" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteReset</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteReset" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>sqliteStep</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AsqliteStep" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>stmtChanges</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AstmtChanges" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>stmtExec</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AstmtExec" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AstmtExec" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>stmtExec0</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AstmtExec0" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>stmtExec0t</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AstmtExec0t" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>stmtExecImm</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AstmtExecImm" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>stmtExecImm0</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AstmtExecImm0" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>stmtExecute</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AstmtExecute" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>stmtFetch</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AstmtFetch" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AstmtFetch" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>stmtFinalise</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AstmtFinalise" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AstmtFinalise" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>stmtPrepare</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AstmtPrepare" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AstmtPrepare" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AstmtPrepare" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>stmtReset</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AstmtReset" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-T.html view
@@ -0,0 +1,300 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (T)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>TestException</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3ATestException" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>TestFailure</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3ATestFailure" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>TestResult</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#t%3ATestResult" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>TestSuccess</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3ATestSuccess" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>terminate</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3Aterminate" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>testForError</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AtestForError" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AtestForError" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>testForErrorWithPtr</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AtestForErrorWithPtr" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AtestForErrorWithPtr" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>throwDB</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AthrowDB" +>Database.InternalEnumerator</A +>, <A HREF="Database-Enumerator.html#v%3AthrowDB" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>throwIfDBNull</TD +><TD CLASS="indexlinks" +><A HREF="Database-InternalEnumerator.html#v%3AthrowIfDBNull" +>Database.InternalEnumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>throwOCI</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AthrowOCI" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>throwPG</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AthrowPG" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>throwSqlite</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#v%3AthrowSqlite" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>throwUserError</TD +><TD CLASS="indexlinks" +><A HREF="Test-MiniUnit.html#v%3AthrowUserError" +>Test.MiniUnit</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>toCChar</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AtoCChar" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>toCInt</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#v%3AtoCInt" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>toUTF8</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3AtoUTF8" +>Foreign.C.UTF8</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>toUTF8String</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3AtoUTF8String" +>Foreign.C.UTF8</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-U.html view
@@ -0,0 +1,214 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (U)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>UTF16CString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF16CString" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>UTF8CString</TD +><TD CLASS="indexlinks" +><A HREF="Database-Sqlite-SqliteFunctions.html#t%3AUTF8CString" +>Database.Sqlite.SqliteFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>UserHandle</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AUserHandle" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" COLSPAN="2" +>UserStruct</TD +></TR +><TR +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#t%3AUserStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AUserStruct" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>user</TD +><TD CLASS="indexlinks" +><A HREF="Database-Stub-Enumerator.html#v%3Auser" +>Database.Stub.Enumerator</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>utcTimeToBuffer</TD +><TD CLASS="indexlinks" +><A HREF="Database-Oracle-OCIFunctions.html#v%3AutcTimeToBuffer" +>Database.Oracle.OCIFunctions</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>utcTimeToPGDatetime</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AutcTimeToPGDatetime" +>Database.Util</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>utf8RoundTrip</TD +><TD CLASS="indexlinks" +><A HREF="Database-Test-Util.html#v%3Autf8RoundTrip" +>Database.Test.Util</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-V.html view
@@ -0,0 +1,146 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (V)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>Void</TD +><TD CLASS="indexlinks" +><A HREF="Database-PostgreSQL-PGFunctions.html#t%3AVoid" +>Database.PostgreSQL.PGFunctions</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-W.html view
@@ -0,0 +1,210 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (W)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>withBoundStatement</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AwithBoundStatement" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>withContinuedSession</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AwithContinuedSession" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>withCursor</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AwithCursor" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>withPreparedStatement</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AwithPreparedStatement" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>withSession</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AwithSession" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>withTransaction</TD +><TD CLASS="indexlinks" +><A HREF="Database-Enumerator.html#v%3AwithTransaction" +>Database.Enumerator</A +>, Database.Oracle.Enumerator, Database.PostgreSQL.Enumerator, Database.Sqlite.Enumerator</TD +></TR +><TR +><TD CLASS="indexentry" +>withUTF8String</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3AwithUTF8String" +>Foreign.C.UTF8</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>withUTF8StringLen</TD +><TD CLASS="indexlinks" +><A HREF="Foreign-C-UTF8.html#v%3AwithUTF8StringLen" +>Foreign.C.UTF8</A +></TD +></TR +><TR +><TD CLASS="indexentry" +>wordsBy</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AwordsBy" +>Database.Util</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index-Z.html view
@@ -0,0 +1,150 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +><TD +><A HREF="doc-index-Z.html" +>Z</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index (Z)</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD CLASS="indexentry" +>zeroPad</TD +><TD CLASS="indexlinks" +><A HREF="Database-Util.html#v%3AzeroPad" +>Database.Util</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/doc-index.html view
@@ -0,0 +1,132 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +> (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Index</TD +></TR +><TR +><TD +><TABLE CELLPADDING="0" CELLSPACING="5" +><TR +><TD +><A HREF="doc-index-A.html" +>A</A +></TD +><TD +><A HREF="doc-index-B.html" +>B</A +></TD +><TD +><A HREF="doc-index-C.html" +>C</A +></TD +><TD +><A HREF="doc-index-D.html" +>D</A +></TD +><TD +><A HREF="doc-index-E.html" +>E</A +></TD +><TD +><A HREF="doc-index-F.html" +>F</A +></TD +><TD +><A HREF="doc-index-G.html" +>G</A +></TD +><TD +><A HREF="doc-index-H.html" +>H</A +></TD +><TD +><A HREF="doc-index-I.html" +>I</A +></TD +><TD +><A HREF="doc-index-L.html" +>L</A +></TD +><TD +><A HREF="doc-index-M.html" +>M</A +></TD +><TD +><A HREF="doc-index-N.html" +>N</A +></TD +><TD +><A HREF="doc-index-O.html" +>O</A +></TD +><TD +><A HREF="doc-index-P.html" +>P</A +></TD +><TD +><A HREF="doc-index-Q.html" +>Q</A +></TD +><TD +><A HREF="doc-index-R.html" +>R</A +></TD +><TD +><A HREF="doc-index-S.html" +>S</A +></TD +><TD +><A HREF="doc-index-T.html" +>T</A +></TD +><TD +><A HREF="doc-index-U.html" +>U</A +></TD +><TD +><A HREF="doc-index-V.html" +>V</A +></TD +><TD +><A HREF="doc-index-W.html" +>W</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/haddock.css view
@@ -0,0 +1,236 @@+/* -------- Global things --------- */ + +BODY { + background-color: #ffffff; + color: #000000; + font-family: sans-serif; + } + +A:link { color: #0000e0; text-decoration: none } +A:visited { color: #0000a0; text-decoration: none } +A:hover { background-color: #e0e0ff; text-decoration: none } + +TABLE.vanilla { + width: 100%; + border-width: 0px; + /* I can't seem to specify cellspacing or cellpadding properly using CSS... */ +} + +TABLE.vanilla2 { + border-width: 0px; +} + +/* <TT> font is a little too small in MSIE */ +TT { font-size: 100%; } +PRE { font-size: 100%; } + +LI P { margin: 0pt } + +TD { + border-width: 0px; +} + +TABLE.narrow { + border-width: 0px; +} + +TD.s8 { height: 8px; } +TD.s15 { height: 15px; } + +SPAN.keyword { text-decoration: underline; } + +/* Resize the buttom image to match the text size */ +IMG.coll { width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em } + +/* --------- Contents page ---------- */ + +DIV.node { + padding-left: 3em; +} + +DIV.cnode { + padding-left: 1.75em; +} + +SPAN.pkg { + position: absolute; + left: 50em; +} + +/* --------- Documentation elements ---------- */ + +TD.children { + padding-left: 25px; + } + +TD.synopsis { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace + } + +TD.decl { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; + } + +/* + arg is just like decl, except that wrapping is not allowed. It is + used for function and constructor arguments which have a text box + to the right, where if wrapping is allowed the text box squashes up + the declaration by wrapping it. +*/ +TD.arg { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; + white-space: nowrap; + width: 50% + } + +TD.recfield { padding-left: 20px } + +TD.doc { + padding-top: 2px; + padding-left: 10px; + } + +TD.ndoc { + padding: 2px; + } + +TD.rdoc { + padding: 2px; + padding-left: 10px; + width: 100%; + } + +TD.body { + padding-left: 10px + } + +TD.pkg { + width: 100%; + padding-left: 10px +} + +TD.indexentry { + vertical-align: top; + padding-right: 10px + } + +TD.indexannot { + vertical-align: top; + padding-left: 20px; + white-space: nowrap + } + +TD.indexlinks { + width: 100% + } + +/* ------- Section Headings ------- */ + +TD.section1 { + padding-top: 15px; + font-weight: bold; + font-size: 150% + } + +TD.section2 { + padding-top: 10px; + font-weight: bold; + font-size: 130% + } + +TD.section3 { + padding-top: 5px; + font-weight: bold; + font-size: 110% + } + +TD.section4 { + font-weight: bold; + font-size: 100% + } + +/* -------------- The title bar at the top of the page */ + +TD.infohead { + color: #ffffff; + font-weight: bold; + padding-right: 10px; + text-align: left; +} + +TD.infoval { + color: #ffffff; + padding-right: 10px; + text-align: left; +} + +TD.topbar { + background-color: #000099; + padding: 5px; +} + +TD.title { + color: #ffffff; + padding-left: 10px; + width: 100% + } + +TD.topbut { + padding-left: 5px; + padding-right: 5px; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + white-space: nowrap; + } + +TD.topbut A:link { + color: #ffffff + } + +TD.topbut A:visited { + color: #ffff00 + } + +TD.topbut A:hover { + background-color: #6060ff; + } + +TD.topbut:hover { + background-color: #6060ff + } + +TD.modulebar { + background-color: #0077dd; + padding: 5px; + border-top-width: 1px; + border-top-color: #ffffff; + border-top-style: solid; + } + +/* --------- The page footer --------- */ + +TD.botbar { + background-color: #000099; + color: #ffffff; + padding: 5px + } +TD.botbar A:link { + color: #ffffff; + text-decoration: underline + } +TD.botbar A:visited { + color: #ffff00 + } +TD.botbar A:hover { + background-color: #6060ff + } +
+ doc/html/haddock.js view
@@ -0,0 +1,15 @@+// Haddock JavaScript utilities+function toggle(button,id)+{+ var n = document.getElementById(id).style;+ if (n.display == "none")+ {+ button.src = "minus.gif";+ n.display = "block";+ }+ else+ {+ button.src = "plus.gif";+ n.display = "none";+ }+}
+ doc/html/haskell_icon.gif view
binary file changed (absent → 911 bytes)
+ doc/html/index.html view
@@ -0,0 +1,553 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +></TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +></TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>Modules</TD +></TR +><TR +><TD +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" +><TR +><TD STYLE="width: 50em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:0')" ALT="show/hide" +>Control</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:0" STYLE="display:block;" +><TR +><TD STYLE="width: 48em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:1')" ALT="show/hide" +>Exception</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:1" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Control-Exception-MonadIO.html" +>Control.Exception.MonadIO</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD STYLE="width: 50em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:2')" ALT="show/hide" +>Database</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:2" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 48em" +><A HREF="Database-Enumerator.html" +>Database.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 48em" +><A HREF="Database-InternalEnumerator.html" +>Database.InternalEnumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="width: 48em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:3')" ALT="show/hide" +>Oracle</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:3" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Oracle-Enumerator.html" +>Database.Oracle.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Oracle-OCIConstants.html" +>Database.Oracle.OCIConstants</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Oracle-OCIFunctions.html" +>Database.Oracle.OCIFunctions</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="width: 46em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:4')" ALT="show/hide" +>Test</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:4" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 44em" +><A HREF="Database-Oracle-Test-Enumerator.html" +>Database.Oracle.Test.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 44em" +><A HREF="Database-Oracle-Test-OCIFunctions.html" +>Database.Oracle.Test.OCIFunctions</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD STYLE="width: 48em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:5')" ALT="show/hide" +>PostgreSQL</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:5" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-PostgreSQL-Enumerator.html" +>Database.PostgreSQL.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-PostgreSQL-PGFunctions.html" +>Database.PostgreSQL.PGFunctions</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="width: 46em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:6')" ALT="show/hide" +>Test</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:6" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 44em" +><A HREF="Database-PostgreSQL-Test-Enumerator.html" +>Database.PostgreSQL.Test.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 44em" +><A HREF="Database-PostgreSQL-Test-PGFunctions.html" +>Database.PostgreSQL.Test.PGFunctions</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD STYLE="width: 48em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:7')" ALT="show/hide" +>Sqlite</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:7" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Sqlite-Enumerator.html" +>Database.Sqlite.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Sqlite-SqliteFunctions.html" +>Database.Sqlite.SqliteFunctions</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="width: 46em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:8')" ALT="show/hide" +>Test</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:8" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 44em" +><A HREF="Database-Sqlite-Test-Enumerator.html" +>Database.Sqlite.Test.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 44em" +><A HREF="Database-Sqlite-Test-SqliteFunctions.html" +>Database.Sqlite.Test.SqliteFunctions</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD STYLE="width: 48em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:9')" ALT="show/hide" +>Stub</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:9" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Stub-Enumerator.html" +>Database.Stub.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="width: 46em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:10')" ALT="show/hide" +>Test</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:10" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 44em" +><A HREF="Database-Stub-Test-Enumerator.html" +>Database.Stub.Test.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD STYLE="width: 48em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:11')" ALT="show/hide" +>Test</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:11" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Test-Enumerator.html" +>Database.Test.Enumerator</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Test-MultiConnect.html" +>Database.Test.MultiConnect</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Test-Performance.html" +>Database.Test.Performance</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Database-Test-Util.html" +>Database.Test.Util</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 48em" +><A HREF="Database-Util.html" +>Database.Util</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD STYLE="width: 50em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:12')" ALT="show/hide" +>Foreign</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:12" STYLE="display:block;" +><TR +><TD STYLE="width: 48em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:13')" ALT="show/hide" +>C</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:13" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Foreign-C-UTF8.html" +>Foreign.C.UTF8</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 50em" +><A HREF="Main.html" +>Main</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="width: 50em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:14')" ALT="show/hide" +>Test</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:14" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 48em" +><A HREF="Test-MiniUnit.html" +>Test.MiniUnit</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 48em" +><A HREF="Test-MiniUnitTest.html" +>Test.MiniUnitTest</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 0.8</TD +></TR +></TABLE +></BODY +></HTML +>
+ doc/html/minus.gif view
binary file changed (absent → 56 bytes)
+ doc/html/plus.gif view
binary file changed (absent → 59 bytes)