persistent-mysql-haskell-0.1.0.0: A pure haskell backend for the persistent library using MySQL database server.

Safe HaskellNone
LanguageHaskell98

Database.Persist.MySQL

Contents

Description

A MySQL backend for persistent.

Synopsis

Documentation

withMySQLPool Source #

Arguments

:: (MonadIO m, MonadLogger m, MonadBaseControl IO m, IsSqlBackend backend) 
=> MySQLConnectInfo

Connection information.

-> Int

Number of connections to be kept open in the pool.

-> (Pool backend -> 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.

withMySQLConn Source #

Arguments

:: (MonadBaseControl IO m, MonadIO m, MonadLogger m, IsSqlBackend backend) 
=> MySQLConnectInfo

Connection information.

-> (backend -> 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.

createMySQLPool Source #

Arguments

:: (MonadBaseControl IO m, MonadIO m, MonadLogger m, IsSqlBackend backend) 
=> MySQLConnectInfo

Connection information.

-> Int

Number of connections to be kept open in the pool.

-> m (Pool backend) 

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.

mkMySQLConnectInfo Source #

Arguments

:: String

hostname

-> String

username

-> String

password

-> String

database

-> MySQLConnectInfo 

Public constructor for MySQLConnectInfo.

mkMySQLConf Source #

Arguments

:: MySQLConnectInfo

The connection information.

-> Int

How many connections should be held on the connection pool.

-> MySQLConf 

Public constructor for MySQLConf.

mockMigration :: Migration -> IO () Source #

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.

Orphan instances