MySQLPool

A lightweight convenience interface to a MySQL/MariaDB database using vibe.d's ConnectionPool.

You have to include vibe.d in your project to be able to use this class. If you don't want to, refer to mysql.connection.Connection.

If, for any reason, this class doesn't suit your needs, it's easy to just use vibe.d's ConnectionPool directly. Simply provide it with a delegate that creates a new mysql.connection.Connection and does any other custom processing if needed.

Constructors

this
this(string host, string user, string password, string database, ushort port, uint maxConcurrent, SvrCapFlags capFlags, void delegate(Connection) onNewConnection)
this(string host, string user, string password, string database, ushort port, SvrCapFlags capFlags, void delegate(Connection) onNewConnection)
this(string host, string user, string password, string database, ushort port, void delegate(Connection) onNewConnection)
this(string connStr, uint maxConcurrent, SvrCapFlags capFlags, void delegate(Connection) onNewConnection)
this(string connStr, SvrCapFlags capFlags, void delegate(Connection) onNewConnection)
this(string connStr, void delegate(Connection) onNewConnection)

Sets up a connection pool with the provided connection settings.

Members

Functions

lockConnection
auto lockConnection()

Obtain a connection. If one isn't available, a new one will be created.

Properties

maxConcurrency
uint maxConcurrency [@property setter]

Forwards to vibe.d's ConnectionPool.maxConcurrency

maxConcurrency
uint maxConcurrency [@property getter]

Forwards to vibe.d's ConnectionPool.maxConcurrency

onNewConnection
void delegate(Connection) onNewConnection [@property setter]
void delegate(Connection) onNewConnection [@property getter]

Get/set a callback delegate to be run every time a new connection is created.

Meta