Command

(deprecated) 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

this
this(Connection con)

Construct a naked Command object

this
this(Connection con, const(char)[] sql)

Construct a Command object complete with SQL

Members

Functions

bindParameter
deprecated void bindParameter(T val, size_t pIndex, ParameterSpecialization psn)

Bind a D variable to a prepared statement parameter.

bindParameterTuple
deprecated void bindParameterTuple(T args)

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

bindParameters
deprecated void bindParameters(Variant[] va, ParameterSpecialization[] psnList)

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

execFunction
deprecated bool execFunction(string name, T target, U args)

Execute a stored function, with any required input variables, and store the return value into a D variable.

execPrepared
deprecated bool execPrepared(ulong ra)

Execute a prepared command.

execPreparedResult
deprecated ResultSet execPreparedResult(ColumnSpecialization[] csa)

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

execPreparedSequence
deprecated ResultRange execPreparedSequence(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.

execPreparedTuple
deprecated void execPreparedTuple(T args)

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

execProcedure
deprecated bool execProcedure(string name, T args)

Execute a stored procedure, with any required input variables.

execSQL
deprecated bool execSQL(ulong ra)
deprecated bool execSQL()

Execute a one-off SQL command.

execSQLResult
deprecated ResultSet execSQLResult(ColumnSpecialization[] csa)

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

execSQLSequence
deprecated ResultRange execSQLSequence(ColumnSpecialization[] csa)

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
deprecated void execSQLTuple(T args)

Execute a one-off SQL command to place result values into a set of D variables.

getArg
deprecated Variant getArg(size_t index)

Prepared statement parameter getter.

getNextRow
deprecated Row getNextRow()

Get the next Row of a pending result set.

param
deprecated Variant param(size_t index)

Access a prepared statement parameter for update.

prepare
deprecated void prepare()

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

purgeResult
deprecated ulong purgeResult()

Flush any outstanding result set elements.

releaseStatement
deprecated void releaseStatement()

Release a prepared statement.

setNullParam
deprecated void setNullParam(size_t index)

Sets a prepared statement parameter to NULL.

Properties

lastInsertID
deprecated ulong lastInsertID [@property getter]

After a command that inserted a row into a table with an auto-increment ID column, this method allows you to retrieve the last insert ID.

numParams
deprecated ushort numParams [@property getter]

Gets the number of parameters in this Command

preparedFieldDescriptions
deprecated FieldDescription[] preparedFieldDescriptions [@property getter]

Gets the prepared header's field descriptions.

preparedParamDescriptions
deprecated ParamDescription[] preparedParamDescriptions [@property getter]

Gets the prepared header's param descriptions.

resultFieldDescriptions
deprecated FieldDescription[] resultFieldDescriptions [@property getter]

Gets the result header's field descriptions.

rowsPending
deprecated bool rowsPending [@property getter]

Gets whether rows are pending

sql
const(char)[] sql [@property getter]

Get the current SQL for the Command

sql
const(char)[] sql [@property setter]

Set a new SQL command.

Variables

_con
Connection _con;
Undocumented in source.
_prepared
Prepared _prepared;
Undocumented in source.
_prevFunc
string _prevFunc;
Undocumented in source.
_sql
string _sql;
Undocumented in source.

Meta