Safe Haskell | None |
---|---|
Language | Haskell98 |
A MySQL backend for persistent
.
- withMySQLPool :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => ConnectInfo -> Int -> (ConnectionPool -> m a) -> m a
- withMySQLConn :: (MonadBaseControl IO m, MonadIO m, MonadLogger m) => ConnectInfo -> (SqlBackend -> m a) -> m a
- createMySQLPool :: (MonadBaseControl IO m, MonadIO m, MonadLogger m) => ConnectInfo -> Int -> m ConnectionPool
- data ConnectInfo :: * = ConnectInfo {
- connectHost :: String
- connectPort :: Word16
- connectUser :: String
- connectPassword :: String
- connectDatabase :: String
- connectOptions :: [Option]
- connectPath :: FilePath
- connectSSL :: Maybe SSLInfo
- data SSLInfo :: * = SSLInfo {}
- defaultConnectInfo :: ConnectInfo
- defaultSSLInfo :: SSLInfo
- data MySQLConf = MySQLConf {}
Documentation
:: (MonadIO m, MonadLogger m, MonadBaseControl IO m) | |
=> ConnectInfo | Connection information. |
-> Int | Number of connections to be kept open in the pool. |
-> (ConnectionPool -> m a) | Action to be executed that uses the connection pool. |
-> m a |
Create a MySQL 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.
:: (MonadBaseControl IO m, MonadIO m, MonadLogger m) | |
=> ConnectInfo | Connection information. |
-> (SqlBackend -> m a) | Action to be executed that uses the connection. |
-> m a |
Same as withMySQLPool
, but instead of opening a pool
of connections, only one connection is opened.
:: (MonadBaseControl IO m, MonadIO m, MonadLogger m) | |
=> ConnectInfo | Connection information. |
-> Int | Number of connections to be kept open in the pool. |
-> m ConnectionPool |
Create a MySQL connection pool. Note that it's your
responsibility to properly close the connection pool when
unneeded. Use withMySQLPool
for automatic resource control.
data ConnectInfo :: *
ConnectInfo | |
|
Information required to connect to a MySQL database
using persistent
's generic facilities. These values are the
same that are given to withMySQLPool
.
MySQLConf | |
|