Struct Command
Encapsulation of an SQL command or query.
A Command be be either a one-off SQL query, or may use 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.
Constructors
Name | Description |
---|---|
this
|
Construct a Command object complete with SQL |
this
|
Construct a naked Command object |
Properties
Name | Type | Description |
---|---|---|
lastInsertID
[get]
|
ulong |
After a command that inserted a row into a table with an auto-increment |
numParams
[get]
|
ushort |
Gets the number of parameters in this Command |
preparedFieldDescriptions
[get]
|
FieldDescription[] |
Gets the prepared header's field descriptions. |
preparedParamDescriptions
[get]
|
ParamDescription[] |
Gets the prepared header's param descriptions. |
resultFieldDescriptions
[get]
|
FieldDescription[] |
Gets the result header's field descriptions. |
rowsPending
[get]
|
bool |
Gets whether rows are pending |
sql
[set]
|
const(char)[] |
Set a new SQL command. |
sql
[get]
|
const(char)[] |
Get the current SQL for the Command |
Methods
Name | Description |
---|---|
bindParameter
|
Bind a D variable to a prepared statement parameter. |
bindParameters
|
Bind a Variant[] as the parameters of a prepared statement. |
bindParameterTuple
|
Bind a tuple of D variables to the parameters of a prepared statement. |
execFunction
|
Execute a stored function, with any required input variables, and store the return value into a D variable. |
execPrepared
|
Execute a prepared command. |
execPreparedResult
|
Execute a prepared SQL command for the case where you expect a result set, and want it all at once. |
execPreparedSequence
|
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. |
execPreparedTuple
|
Execute a prepared SQL command to place result values into a set of D variables. |
execProcedure
|
Execute a stored procedure, with any required input variables. |
execSQL
|
Execute a one-off SQL command. |
execSQLResult
|
Execute a one-off SQL command for the case where you expect a result set, and want it all at once. |
execSQLSequence
|
Execute a one-off SQL command for the case where you expect a result set, and want to deal with it a row at a time. |
execSQLTuple
|
Execute a one-off SQL command to place result values into a set of D variables. |
getArg
|
Prepared statement parameter getter. |
getNextRow
|
Get the next Row of a pending result set. |
opAssign
|
|
param
|
Access a prepared statement parameter for update. |
prepare
|
Submit an SQL command to the server to be compiled into a prepared statement. |
purgeResult
|
Flush any outstanding result set elements. |
releaseStatement
|
Release a prepared statement. |
setNullParam
|
Sets a prepared statement parameter to NULL. |