PreparedRegistrations

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

Used by Connection and MySQLPool.

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(string sql)

Returns null if not found

queueAllForRelease
void queueAllForRelease()

Queues all prepared statements for release.

queueForRelease
void queueForRelease(string sql)

Queue a prepared statement for release.

registerIfNeeded
Payload registerIfNeeded(string sql, Payload delegate(string) doRegister)

If already registered, simply returns the cached Payload.

unqueueForRelease
void unqueueForRelease(string sql)

Remove a statement from the queue to be released.

Variables

directLookup
Payload[string] directLookup;

Lookup payload by sql string.

Meta