-- 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.
--
-- Known problems:
--
--
-- - This package does not support statements inside other
-- statements.
--
@package persistent-mysql
@version 1.0.1
-- | 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 => ConnectInfo -> Int -> (ConnectionPool -> 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) => ConnectInfo -> (Connection -> m a) -> m a
-- | Create a MySQL connection pool. Note that it's your responsability to
-- properly close the connection pool when unneeded. Use
-- withMySQLPool for automatic resource control.
createMySQLPool :: MonadIO m => ConnectInfo -> Int -> m ConnectionPool
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
instance PersistConfig MySQLConf
instance Param P