mysql-native v3.0.0

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


Function MySQLPool.autoRelease

Set a prepared statement to be automatically released from all connections received from this pool.

void autoRelease (
  Prepared prepared
);

void autoRelease (
  const(char[]) sql
);

This also clears any autoRegister which may have been set for this statement.

Calling this is not strictly necessary. The server considers prepared statements to be per-connection, so they'll go away when the connection closes anyway. This is provided in case direct control is actually needed.

Once this has been called, obtaining a connection via lockConnection will automatically release the prepared statement from the connection if it isn't already releases from the connection.

Note, due to the way Vibe.d works, it is not possible to eagerly register or release a statement on all connections already sitting in the pool. This can only be done when locking a connection.

You can stop the pool from continuing to auto-release the statement by calling either autoRegister or clearAuto.