Interface IQueryCommand
What it takes to turn a query and a set of values into a ready-to-run database command. The execution methods build on this, most code runs a QueryCommand through those rather than calling here.
public interface IQueryCommand
- Extension Methods
Properties
Mapper
Maps the query's key names to their slot in the values array.
Mapper Mapper { get; }
Property Value
StartBaseHandlers
The first slot for a literal-injection handler. Slots below it carry parameter values.
int StartBaseHandlers { get; }
Property Value
StartBoolCond
The first slot for a toggle-only condition, the ones that carry no value.
int StartBoolCond { get; }
Property Value
StartSpecialHandlers
The first slot for a special handler, the ones that expand into several parameters.
int StartSpecialHandlers { get; }
Property Value
Methods
SetCommand(DbCommand, object, Span<bool>)
Sets cmd's text and parameters for one run, reading the values from a parameter
object matched to keys by name, and records which keys were used in usageMap.
bool SetCommand(DbCommand cmd, object parameterObj, Span<bool> usageMap)
Parameters
cmdDbCommandThe command to fill.
parameterObjobjectThe object whose members supply the values.
usageMapSpan<bool>Filled with which keys ended up used, so the result can be read back correctly.
Returns
SetCommand(DbCommand, object?[])
Sets cmd's text and parameters for one run from a pre-built values array, the same
array a QueryBuilder holds.
bool SetCommand(DbCommand cmd, object?[] variables)
Parameters
Returns
SetCommand(IDbCommand, object, Span<bool>)
Sets cmd's text and parameters for one run, reading the values from a parameter
object matched to keys by name, and records which keys were used in usageMap.
bool SetCommand(IDbCommand cmd, object parameterObj, Span<bool> usageMap)
Parameters
cmdIDbCommandThe command to fill.
parameterObjobjectThe object whose members supply the values.
usageMapSpan<bool>Filled with which keys ended up used, so the result can be read back correctly.
Returns
SetCommand(IDbCommand, object?[])
Sets cmd's text and parameters for one run from a pre-built values array, the same
array a QueryBuilder holds.
bool SetCommand(IDbCommand cmd, object?[] variables)
Parameters
cmdIDbCommandThe command to fill.
variablesobject[]The values for this run, one slot per key.
Returns
SetCommand<T>(DbCommand, T, Span<bool>)
Sets cmd's text and parameters for one run, reading the values from a parameter
object matched to keys by name, and records which keys were used in usageMap.
bool SetCommand<T>(DbCommand cmd, T parameterObj, Span<bool> usageMap) where T : notnull
Parameters
cmdDbCommandThe command to fill.
parameterObjTThe object whose members supply the values.
usageMapSpan<bool>Filled with which keys ended up used, so the result can be read back correctly.
Returns
Type Parameters
T
SetCommand<T>(DbCommand, ref T, Span<bool>)
Sets cmd's text and parameters for one run, reading the values from a parameter
object matched to keys by name, and records which keys were used in usageMap.
bool SetCommand<T>(DbCommand cmd, ref T parameterObj, Span<bool> usageMap) where T : notnull
Parameters
cmdDbCommandThe command to fill.
parameterObjTThe object whose members supply the values.
usageMapSpan<bool>Filled with which keys ended up used, so the result can be read back correctly.
Returns
Type Parameters
T
SetCommand<T>(IDbCommand, T, Span<bool>)
Sets cmd's text and parameters for one run, reading the values from a parameter
object matched to keys by name, and records which keys were used in usageMap.
bool SetCommand<T>(IDbCommand cmd, T parameterObj, Span<bool> usageMap) where T : notnull
Parameters
cmdIDbCommandThe command to fill.
parameterObjTThe object whose members supply the values.
usageMapSpan<bool>Filled with which keys ended up used, so the result can be read back correctly.
Returns
Type Parameters
T
SetCommand<T>(IDbCommand, ref T, Span<bool>)
Sets cmd's text and parameters for one run, reading the values from a parameter
object matched to keys by name, and records which keys were used in usageMap.
bool SetCommand<T>(IDbCommand cmd, ref T parameterObj, Span<bool> usageMap) where T : notnull
Parameters
cmdIDbCommandThe command to fill.
parameterObjTThe object whose members supply the values.
usageMapSpan<bool>Filled with which keys ended up used, so the result can be read back correctly.
Returns
Type Parameters
T