mysql-native v2.2.2

API Reference Home: [This Version] [Latest Version] [Other Versions]


Class MySQLPool

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

class MySQLPool ;

You have to include vibe.d in your project to be able to use this class. If you don't want to, refer to 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 Connection and does any other custom processing if needed.

Constructors

NameDescription
this Sets up a connection pool with the provided connection settings.

Properties

NameTypeDescription
maxConcurrency[get, set] uintForwards to vibe.d's ConnectionPool.maxConcurrency
onNewConnection[get, set] void delegate(Connection)Get/set a callback delegate to be run every time a new connection is created.

Methods

NameDescription
autoRegister Set a prepared statement to be automatically registered on all connections received from this pool.
autoRelease Set a prepared statement to be automatically released from all connections received from this pool.
clearAllRegistrations Removes ALL prepared statement autoRegister and autoRelease which have been set.
clearAuto Removes any autoRegister or autoRelease which may have been set for this prepared statement.
isAutoCleared Is the given statement set for NEITHER auto-register NOR auto-release on connections obtained from this connection pool?
isAutoRegistered Is the given statement set to be automatically registered on all connections obtained from this connection pool?
isAutoReleased Is the given statement set to be automatically released on all connections obtained from this connection pool?
lockConnection Obtain a connection. If one isn't available, a new one will be created.