-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Backend for the persistent library using MySQL database server.
--
-- This package contains a backend for persistent using the MySQL
-- database server. Internally it uses the mysql-simple and
-- mysql packages in order to access the database.
--
-- This package supports only MySQL 5.1 and above. However, it has been
-- tested only on MySQL 5.5. Only the InnoDB storage engine is officially
-- supported.
--
-- Known problems:
--
--
-- - This package does not support statements inside other
-- statements.
--
@package persistent-mysql
@version 2.6
-- | A MySQL backend for persistent.
module Database.Persist.MySQL
-- | 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.
withMySQLPool :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, IsSqlBackend backend) => ConnectInfo -> Int -> (Pool backend -> m a) -> m a
-- | Same as withMySQLPool, but instead of opening a pool of
-- connections, only one connection is opened.
withMySQLConn :: (MonadBaseControl IO m, MonadIO m, MonadLogger m, IsSqlBackend backend) => ConnectInfo -> (backend -> m a) -> m a
-- | 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.
createMySQLPool :: (MonadBaseControl IO m, MonadIO m, MonadLogger m, IsSqlBackend backend) => ConnectInfo -> Int -> m (Pool backend)
data ConnectInfo :: *
ConnectInfo :: String -> Word16 -> String -> String -> String -> [Option] -> FilePath -> Maybe SSLInfo -> ConnectInfo
[connectHost] :: ConnectInfo -> String
[connectPort] :: ConnectInfo -> Word16
[connectUser] :: ConnectInfo -> String
[connectPassword] :: ConnectInfo -> String
[connectDatabase] :: ConnectInfo -> String
[connectOptions] :: ConnectInfo -> [Option]
[connectPath] :: ConnectInfo -> FilePath
[connectSSL] :: ConnectInfo -> Maybe SSLInfo
data SSLInfo :: *
SSLInfo :: FilePath -> FilePath -> FilePath -> FilePath -> String -> SSLInfo
[sslKey] :: SSLInfo -> FilePath
[sslCert] :: SSLInfo -> FilePath
[sslCA] :: SSLInfo -> FilePath
[sslCAPath] :: SSLInfo -> FilePath
-- | Comma-separated list of cipher names.
[sslCiphers] :: SSLInfo -> String
-- | 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" }
--
defaultConnectInfo :: ConnectInfo
-- | Default (empty) information for setting up an SSL connection.
defaultSSLInfo :: SSLInfo
-- | Information required to connect to a MySQL database using
-- persistent's generic facilities. These values are the same
-- that are given to withMySQLPool.
data MySQLConf
MySQLConf :: ConnectInfo -> Int -> MySQLConf
-- | The connection information.
[myConnInfo] :: MySQLConf -> ConnectInfo
-- | How many connections should be held on the connection pool.
[myPoolSize] :: MySQLConf -> Int
-- | Mock a migration even when the database is not present. This function
-- will mock the migration for a database even when the actual database
-- isn't already present in the system.
mockMigration :: Migration -> IO ()
instance GHC.Show.Show Database.Persist.MySQL.MySQLConf
instance Database.MySQL.Simple.Param.Param Database.Persist.MySQL.P
instance Data.Aeson.Types.FromJSON.FromJSON Database.Persist.MySQL.MySQLConf
instance Database.Persist.Class.PersistConfig.PersistConfig Database.Persist.MySQL.MySQLConf