-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Backend for the persistent library using ODBC -- -- This package contains backends for persistent using ODBC. It currently -- supports the following databases: MSSQL, MySql, Oracle, Sqlite, DB2, -- Postgres. Uses HDBC-ODBC for accessing ODBC. @package persistent-odbc @version 0.1.2.2 module Database.Persist.ODBCTypes -- | List of DBMS that are supported data DBType MySQL :: DBType Postgres :: DBType MSSQL :: Bool -> DBType mssql2012 :: DBType -> Bool Oracle :: Bool -> DBType oracle12c :: DBType -> Bool DB2 :: DBType Sqlite :: Bool -> DBType sqlite3619 :: DBType -> Bool mysql :: DBType sqliteMin3619 :: DBType sqlite :: DBType db2 :: DBType oracle :: DBType oracleMin12c :: DBType mssql :: DBType mssqlMin2012 :: DBType postgres :: DBType data MigrationStrategy MigrationStrategy :: ((Int, Int) -> Bool -> Text -> Text) -> (forall a. Show a => [EntityDef a] -> (Text -> IO Statement) -> EntityDef SqlType -> IO (Either [Text] [(Bool, Text)])) -> (EntityDef SqlType -> [PersistValue] -> InsertSqlResult) -> (DBName -> Text) -> DBType -> MigrationStrategy dbmsLimitOffset :: MigrationStrategy -> (Int, Int) -> Bool -> Text -> Text dbmsMigrate :: MigrationStrategy -> forall a. Show a => [EntityDef a] -> (Text -> IO Statement) -> EntityDef SqlType -> IO (Either [Text] [(Bool, Text)]) dbmsInsertSql :: MigrationStrategy -> EntityDef SqlType -> [PersistValue] -> InsertSqlResult dbmsEscape :: MigrationStrategy -> DBName -> Text dbmsType :: MigrationStrategy -> DBType instance Show DBType instance Read DBType -- | A Sqlite backend for persistent. module Database.Persist.MigrateSqlite getMigrationStrategy :: DBType -> MigrationStrategy -- | A DB2 backend for persistent. module Database.Persist.MigrateDB2 getMigrationStrategy :: DBType -> MigrationStrategy -- | A Oracle backend for persistent. module Database.Persist.MigrateOracle getMigrationStrategy :: DBType -> MigrationStrategy -- | A MSSQL backend for persistent. module Database.Persist.MigrateMSSQL getMigrationStrategy :: DBType -> MigrationStrategy -- | A MySQL backend for persistent. module Database.Persist.MigrateMySQL getMigrationStrategy :: DBType -> MigrationStrategy -- | An ODBC backend for persistent. module Database.Persist.MigratePostgres getMigrationStrategy :: DBType -> MigrationStrategy -- | An ODBC backend for persistent. module Database.Persist.ODBC -- | Create an ODBC connection pool and run the given action. The pool is -- properly released after the action finishes using it. Note that you -- should not use the given ConnectionPool outside the action -- since it may be already been released. withODBCPool :: MonadIO m => Maybe DBType -> ConnectionString -> Int -> (ConnectionPool -> m a) -> m a -- | Same as withODBCPool, but instead of opening a pool of -- connections, only one connection is opened. withODBCConn :: (MonadIO m, MonadBaseControl IO m) => Maybe DBType -> ConnectionString -> (Connection -> m a) -> m a -- | Create an ODBC connection pool. Note that it's your responsibility to -- properly close the connection pool when unneeded. Use -- withODBCPool for an automatic resource control. createODBCPool :: MonadIO m => Maybe DBType -> ConnectionString -> Int -> m ConnectionPool -- | An HDBC-odbc connection string. A simple example of -- connection string would be DSN=hdbctest1. type ConnectionString = String -- | Information required to connect to a PostgreSQL database using -- persistent's generic facilities. These values are the same -- that are given to withODBCPool. data OdbcConf OdbcConf :: ConnectionString -> Int -> String -> OdbcConf -- | The connection string. odbcConnStr :: OdbcConf -> ConnectionString -- | How many connections should be held on the connection pool. odbcPoolSize :: OdbcConf -> Int odbcDbtype :: OdbcConf -> String -- | Generate a persistent Connection from an odbc Connection openSimpleConn :: Maybe DBType -> Connection -> IO Connection -- | List of DBMS that are supported data DBType MySQL :: DBType Postgres :: DBType MSSQL :: Bool -> DBType mssql2012 :: DBType -> Bool Oracle :: Bool -> DBType oracle12c :: DBType -> Bool DB2 :: DBType Sqlite :: Bool -> DBType sqlite3619 :: DBType -> Bool mysql :: DBType postgres :: DBType mssqlMin2012 :: DBType mssql :: DBType oracleMin12c :: DBType oracle :: DBType db2 :: DBType sqlite :: DBType instance Show P instance Convertible SqlValue P instance Convertible P SqlValue instance PersistConfig OdbcConf