Safe Haskell | None |
---|---|
Language | Haskell98 |
Database.Groundhog.MySQL
- withMySQLPool :: (MonadBaseControl IO m, MonadIO m) => ConnectInfo -> Int -> (Pool MySQL -> m a) -> m a
- withMySQLConn :: (MonadBaseControl IO m, MonadIO m) => ConnectInfo -> (MySQL -> m a) -> m a
- createMySQLPool :: MonadIO m => ConnectInfo -> Int -> m (Pool MySQL)
- runDbConn :: (MonadIO m, MonadBaseControl IO m, ConnectionManager conn, ExtractConnection cm conn) => Action conn a -> cm -> m a
- newtype MySQL = MySQL Connection
- module Database.Groundhog
- module Database.Groundhog.Generic.Sql.Functions
- data ConnectInfo :: * = ConnectInfo {}
- data SSLInfo :: * = SSLInfo {}
- defaultConnectInfo :: ConnectInfo
- defaultSSLInfo :: SSLInfo
Documentation
Arguments
:: (MonadBaseControl IO m, MonadIO m) | |
=> ConnectInfo | |
-> Int | number of connections to open |
-> (Pool MySQL -> m a) | |
-> m a |
withMySQLConn :: (MonadBaseControl IO m, MonadIO m) => ConnectInfo -> (MySQL -> m a) -> m a Source #
Arguments
:: MonadIO m | |
=> ConnectInfo | |
-> Int | number of connections to open |
-> m (Pool MySQL) |
runDbConn :: (MonadIO m, MonadBaseControl IO m, ConnectionManager conn, ExtractConnection cm conn) => Action conn a -> cm -> m a #
Runs action within connection. It can handle a simple connection, a pool of them, etc.
Constructors
MySQL Connection |
Instances
module Database.Groundhog
data ConnectInfo :: * #
Constructors
ConnectInfo | |
Fields
|
Instances
Constructors
SSLInfo | |
defaultConnectInfo :: ConnectInfo #
Default information for setting up a connection.
Defaults are as follows:
- Server on
localhost
- User
root
- No password
- Database
test
- Character set
utf8
Use as in the following example:
connect defaultConnectInfo { connectHost = "db.example.com" }
Default (empty) information for setting up an SSL connection.