Database.HDBC.Types: exported symbols usage examples

Symbols

  • fromSql See 3 Occurences [+] Collapse [-]
    Found in Database.HDBC from the package HDBC
    -}
    
    module Database.HDBC 
        (-- * Introduction
         -- $introduction
    
         -- ** Features
         -- $features
    
         -- ** Available Drivers
         -- $drivers
    
         -- * Typing of transfer data
         SqlValue(..),
         toSql, fromSql, safeFromSql, nToSql, iToSql, posixToSql, 
    
         -- * Database Connections
         IConnection,
         disconnect, clone,
         -- ** Wrapped Connections
    

    Found in Database.HDBC.Utils from the package HDBC
    {- | Strict version of 'fetchAllRows'.  Does not have the side-effects
    of 'fetchAllRows', but forces the entire result set to be buffered
    in memory. -}
    fetchAllRows' :: Statement -> IO [[SqlValue]]
    fetchAllRows' sth =
        do res <- fetchAllRows sth
           _ <- evalAll res
           return res
    
    {- | Like 'fetchAllRows', but return Maybe Strings instead of 'SqlValue's. -}
    sFetchAllRows :: Statement -> IO [[Maybe String]]
    sFetchAllRows sth =
        do res <- fetchAllRows sth
           return $ map (map fromSql) res
    
    {- | Strict version of 'sFetchAllRows'. -}
    sFetchAllRows' :: Statement -> IO [[Maybe String]]
    sFetchAllRows' sth =
        do res <- sFetchAllRows sth
    

    Found in Database.HDBC.Utils from the package HDBC
    {- | Like 'executeMany', but take a list of Maybe Strings instead of
       'SqlValue's. -}
    sExecuteMany :: Statement -> [[Maybe String]] -> IO ()
    sExecuteMany sth lst = 
        executeMany sth (map (map toSql) lst)
    
    {- | Like 'fetchRow', but return a list of Maybe Strings instead of
       'SqlValue's. -}
    sFetchRow :: Statement -> IO (Maybe [Maybe String])
    sFetchRow sth =
        do res <- fetchRow sth
           case res of
             Nothing -> return Nothing
             Just x -> return $ Just $ map fromSql x
    
    {- | Execute some code.  If any uncaught exception occurs, run
    'rollback' and re-raise it.  Otherwise, run 'commit' and return.
    
    This function, therefore, encapsulates the logical property that a transaction
    

    iToSql See 1 Occurences [+] Collapse [-]
    Found in Database.HDBC from the package HDBC
    -}
    
    module Database.HDBC 
        (-- * Introduction
         -- $introduction
    
         -- ** Features
         -- $features
    
         -- ** Available Drivers
         -- $drivers
    
         -- * Typing of transfer data
         SqlValue(..),
         toSql, fromSql, safeFromSql, nToSql, iToSql, posixToSql, 
    
         -- * Database Connections
         IConnection,
         disconnect, clone,
         -- ** Wrapped Connections
    

    nToSql See 1 Occurences [+] Collapse [-]
    Found in Database.HDBC from the package HDBC
    -}
    
    module Database.HDBC 
        (-- * Introduction
         -- $introduction
    
         -- ** Features
         -- $features
    
         -- ** Available Drivers
         -- $drivers
    
         -- * Typing of transfer data
         SqlValue(..),
         toSql, fromSql, safeFromSql, nToSql, iToSql, posixToSql, 
    
         -- * Database Connections
         IConnection,
         disconnect, clone,
         -- ** Wrapped Connections
    

    posixToSql See 1 Occurences [+] Collapse [-]
    Found in Database.HDBC from the package HDBC
    -}
    
    module Database.HDBC 
        (-- * Introduction
         -- $introduction
    
         -- ** Features
         -- $features
    
         -- ** Available Drivers
         -- $drivers
    
         -- * Typing of transfer data
         SqlValue(..),
         toSql, fromSql, safeFromSql, nToSql, iToSql, posixToSql, 
    
         -- * Database Connections
         IConnection,
         disconnect, clone,
         -- ** Wrapped Connections
    

    safeFromSql See 1 Occurences [+] Collapse [-]
    Found in Database.HDBC from the package HDBC
    -}
    
    module Database.HDBC 
        (-- * Introduction
         -- $introduction
    
         -- ** Features
         -- $features
    
         -- ** Available Drivers
         -- $drivers
    
         -- * Typing of transfer data
         SqlValue(..),
         toSql, fromSql, safeFromSql, nToSql, iToSql, posixToSql, 
    
         -- * Database Connections
         IConnection,
         disconnect, clone,
         -- ** Wrapped Connections
    

    toSql See 4 Occurences [+] Collapse [-]
    Found in Database.HDBC from the package HDBC
    -}
    
    module Database.HDBC 
        (-- * Introduction
         -- $introduction
    
         -- ** Features
         -- $features
    
         -- ** Available Drivers
         -- $drivers
    
         -- * Typing of transfer data
         SqlValue(..),
         toSql, fromSql, safeFromSql, nToSql, iToSql, posixToSql, 
    
         -- * Database Connections
         IConnection,
         disconnect, clone,
         -- ** Wrapped Connections
    

    Found in Database.HDBC.Utils from the package HDBC
    {- | Like 'run', but take a list of Maybe Strings instead of 'SqlValue's. -}
    sRun :: IConnection conn => conn -> String -> [Maybe String] -> IO Integer
    sRun conn qry lst =
        run conn qry (map toSql lst)
    
    {- | Like 'execute', but take a list of Maybe Strings instead of
       'SqlValue's. -}
    sExecute :: Statement -> [Maybe String] -> IO Integer
    sExecute sth lst = execute sth (map toSql lst)
    
    {- | Like 'executeMany', but take a list of Maybe Strings instead of
       'SqlValue's. -}
    sExecuteMany :: Statement -> [[Maybe String]] -> IO ()
    sExecuteMany sth lst = 
        executeMany sth (map (map toSql) lst)
    
    {- | Like 'fetchRow', but return a list of Maybe Strings instead of
       'SqlValue's. -}
    sFetchRow :: Statement -> IO (Maybe [Maybe String])
    sFetchRow sth =
    

    Found in Database.HDBC.Utils from the package HDBC
    wrapper around SQL calls. -}
    handleSqlError :: IO a -> IO a
    handleSqlError action =
        catchSql action handler
        where handler e = fail ("SQL error: " ++ show e)
    
    {- | Like 'run', but take a list of Maybe Strings instead of 'SqlValue's. -}
    sRun :: IConnection conn => conn -> String -> [Maybe String] -> IO Integer
    sRun conn qry lst =
        run conn qry (map toSql lst)
    
    {- | Like 'execute', but take a list of Maybe Strings instead of
       'SqlValue's. -}
    sExecute :: Statement -> [Maybe String] -> IO Integer
    sExecute sth lst = execute sth (map toSql lst)
    
    {- | Like 'executeMany', but take a list of Maybe Strings instead of
       'SqlValue's. -}
    sExecuteMany :: Statement -> [[Maybe String]] -> IO ()
    sExecuteMany sth lst = 
    

    Found in Database.HDBC.Utils from the package HDBC
    #endif
    
    {- | Catches 'SqlError's, and re-raises them as IO errors with fail.
    Useful if you don't care to catch SQL errors, but want to see a sane
    error message if one happens.  One would often use this as a high-level
    wrapper around SQL calls. -}
    handleSqlError :: IO a -> IO a
    handleSqlError action =
        catchSql action handler
        where handler e = fail ("SQL error: " ++ show e)
    
    {- | Like 'run', but take a list of Maybe Strings instead of 'SqlValue's. -}
    sRun :: IConnection conn => conn -> String -> [Maybe String] -> IO Integer
    sRun conn qry lst =
        run conn qry (map toSql lst)
    
    {- | Like 'execute', but take a list of Maybe Strings instead of
       'SqlValue's. -}
    sExecute :: Statement -> [Maybe String] -> IO Integer
    sExecute sth lst = execute sth (map toSql lst)
    

    SqlValue No usage example found for this symbol :( Collapse [-]
    SqlError No usage example found for this symbol :( Collapse [-]
    Statement No usage example found for this symbol :( Collapse [-]
    withWConn See 1 Occurences [+] Collapse [-]
    Found in Database.HDBC from the package HDBC
         -- ** Features
         -- $features
    
         -- ** Available Drivers
         -- $drivers
    
         -- * Typing of transfer data
         SqlValue(..),
         toSql, fromSql, safeFromSql, nToSql, iToSql, posixToSql, 
    
         -- * Database Connections
         IConnection,
         disconnect, clone,
         -- ** Wrapped Connections
         ConnWrapper(..), withWConn,
         -- ** Preparing Queries
         run, runRaw, sRun, prepare, quickQuery', quickQuery,
    
         -- ** Transaction Handling
         -- $transactions
    

    ConnWrapper No usage example found for this symbol :( Collapse [-]
    IConnection No usage example found for this symbol :( Collapse [-]