transfer-db-0.3.1.2: ODBC database transfer

Safe HaskellNone
LanguageHaskell2010

Database.TransferDB.Commons

Synopsis

Documentation

finally :: Monad m => m a -> ReaderT r (MaybeT m) b -> ReaderT r (MaybeT m) b Source #

runs the run action, then, runs the afterRun action no matter if the run action failed or succeeded

finally' :: (MonadIO m, MonadFail m) => IO a -> MaybeT IO b -> m b Source #

a MaybeT only variant of finally; it runs the second action and, then the first action and returns the result of the second action

faillog :: (MonadIO m, MonadFail m) => String -> m a Source #

calls fail on the MonadFail logging an error message

faillogS :: (MonadIO m, MonadFail m) => Text -> String -> m a Source #

the variant of faillog taking a log source as parameter

withConnection Source #

Arguments

:: MonadIO m 
=> String

datasource name

-> String

user name

-> String

password

-> (SQLHENV -> SQLHDBC -> ReaderT r (MaybeT m) a)

a function that gets the newly allocated environment and connection handlers

-> ReaderT r (MaybeT m) a 

setup db environment and connect to database

withEnvConnection Source #

Arguments

:: MonadIO m 
=> SQLHENV

handle to environment

-> String

datasource name

-> String

user name

-> String

password

-> (SQLHENV -> SQLHDBC -> ReaderT r (MaybeT m) a)

a function that gets the newly allocated environment and connection handlers

-> ReaderT r (MaybeT m) a 

connect to database in an existing db environment

withEnvConnection' :: (MonadIO m, HasDBInfo r) => SQLHENV -> (SQLHENV -> SQLHDBC -> ReaderT r (MaybeT m) a) -> ReaderT r (MaybeT m) a Source #

call withEnvConnect within a ReaderT environment containing database connnetion info

connect' :: (MonadIO m, MonadFail m, HasDBInfo r) => SQLHENV -> ReaderT r m SQLHDBC Source #

call connect within a ReaderT environment containing database connnetion info

data ProgramOptions Source #

the environment used to run the program

Constructors

ProgramOptions 

Instances

HasDBInfo ProgramOptions Source #

an instance that deals only with source db

data DBInfo Source #

Information about source or destination db

forAllTables :: (MonadFail m, MonadIO m, HasDBInfo r) => SQLHDBC -> a -> (a -> String -> ReaderT r (MaybeT m) a) -> ReaderT r (MaybeT m) a Source #

run an action in the current environment on each table name from the current schema, passing an accumulator value; returns the value of the accumulor