PreparedImpl

Encapsulation of a prepared statement.

Commands that are expected to return a result set - queries - have distinctive methods that are enforced. That is it will be an error to call such a method with an SQL command that does not produce a result set.

struct PreparedImpl {}

Constructors

this
this(Connection conn, string sql)

Submit an SQL command to the server to be compiled into a prepared statement.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Aliases

queryResult
deprecated alias queryResult = querySet

Execute a prepared SQL command for the case where you expect a result set, and want it all at once.

querySequence
deprecated alias querySequence = query

Execute a prepared SQL command for the case where you expect a result set, and want to deal with it one row at a time.

queryTuple
deprecated alias queryTuple = queryRowTuple

Execute a prepared SQL command to place result values into a set of D variables.

Functions

exec
ulong exec()

Execute a prepared command.

execQueryImpl2
bool execQueryImpl2(ulong ra)
Undocumented in source. Be warned that the author may not have intended to support it.
getArg
Variant getArg(size_t index)

Prepared statement parameter getter.

query
ResultRange query(ColumnSpecialization[] csa)

Execute a prepared SQL command for the case where you expect a result set, and want to deal with it one row at a time.

queryRow
Nullable!Row queryRow(ColumnSpecialization[] csa)

Executes a one-off SQL command and returns the first row received, or null if none. Useful for the case where you expect a (possibly empty) result set, and you're either only expecting one row, or only care about the first row.

queryRowTuple
void queryRowTuple(T args)

Execute a prepared SQL command to place result values into a set of D variables.

querySet
ResultSet querySet(ColumnSpecialization[] csa)

Execute a prepared SQL command for the case where you expect a result set, and want it all at once.

queryValue
Nullable!Variant queryValue(ColumnSpecialization[] csa)

Executes a one-off SQL command and returns a single value: The the first column of the first row received. Useful for the case where you expect a (possibly empty) result set, and you're either only expecting one value, or only care about the first value.

release
void release()

Release a prepared statement.

setArg
void setArg(size_t index, T val, ParameterSpecialization psn)

Prepared statement parameter setter.

setArg
void setArg(size_t index, Nullable!T val, ParameterSpecialization psn)
Undocumented in source. Be warned that the author may not have intended to support it.
setArgs
void setArgs(T args)

Bind a tuple of D variables to the parameters of a prepared statement.

setArgs
void setArgs(Variant[] va, ParameterSpecialization[] psnList)

Bind a Variant[] as the parameters of a prepared statement.

setNullArg
void setNullArg(size_t index)

Sets a prepared statement parameter to NULL.

Properties

isReleased
bool isReleased [@property getter]

Has this statement been released?

numArgs
ushort numArgs [@property getter]

Gets the number of arguments this prepared statement expects to be passed in.

preparedFieldDescriptions
FieldDescription[] preparedFieldDescriptions [@property getter]

Gets the prepared header's field descriptions.

preparedParamDescriptions
ParamDescription[] preparedParamDescriptions [@property getter]

Gets the prepared header's param descriptions.

Static functions

analyseParams
ubyte[] analyseParams(Variant[] inParams, ParameterSpecialization[] psa, ubyte[] vals, bool longData)
Undocumented in source. Be warned that the author may not have intended to support it.
makeBitmap
ubyte[] makeBitmap(Variant[] inParams)
Undocumented in source. Be warned that the author may not have intended to support it.
makePSPrefix
ubyte[] makePSPrefix(uint hStmt, ubyte flags)
Undocumented in source. Be warned that the author may not have intended to support it.
sendCommand
void sendCommand(Connection conn, uint hStmt, PreparedStmtHeaders psh, Variant[] inParams, ParameterSpecialization[] psa)
Undocumented in source. Be warned that the author may not have intended to support it.
sendLongData
void sendLongData(Connection conn, uint hStmt, ParameterSpecialization[] psa)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_hStmt
uint _hStmt;
Undocumented in source.
_inParams
Variant[] _inParams;
Undocumented in source.
_psParams
ushort _psParams;
_psWarnings
ushort _psWarnings;
Undocumented in source.
_psa
ParameterSpecialization[] _psa;
Undocumented in source.
_psh
PreparedStmtHeaders _psh;
Undocumented in source.

Meta