mysql-native v3.0.0

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


Function MySQLPool.lockConnection

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

LockedConnection!(mysql.connection.Connection) lockConnection();

The connection returned is actually a LockedConnection!Connection, but it uses alias this, and so can be used just like a Connection. (See vibe.d's LockedConnection documentation.)

No other fiber will be given this Connection as long as your fiber still holds it.

There is no need to close, release or unlock this connection. It is reference-counted and will automatically be returned to the pool once your fiber is done with it.

If you have passed any prepared statements to autoRegister or autoRelease, then those statements will automatically be registered/released on the connection. (Currently, this automatic register/release may actually occur upon the first command sent via the connection.)