PreparedRegistrations

Common functionality for recordkeeping of prepared statement registration and queueing for unregister.

Used by Connection and MySQLPoolImpl.

Templated on payload type. The payload should be an aggregate that includes the field: bool queuedForRelease = false;

Allowing access to directLookup from other parts of mysql-native IS intentional. PreparedRegistrations isn't intended as 100% encapsulation, it's mainly just to factor out common functionality needed by both Connection and MySQLPool.

Members

Functions

clear
void clear()

Eliminate all records of both registered AND queued-for-release statements.

opIndex
Nullable!Payload opIndex(const(char[]) sql)

Returns null if not found

queueAllForRelease
void queueAllForRelease()

Queues all prepared statements for release.

queueForRelease
void queueForRelease(const(char[]) sql)

Queue a prepared statement for release.

registerIfNeeded
Payload registerIfNeeded(const(char[]) sql, Payload delegate(const(char[])) @(safe) doRegister)

If already registered, simply returns the cached Payload.

unqueueForRelease
void unqueueForRelease(const(char[]) sql)

Remove a statement from the queue to be released.

Variables

directLookup
Payload[const(char[])] directLookup;

Lookup payload by sql string.

Meta