Class QueryParameters
How a command binds each of its parameters, and how much it has learned so far. It holds the per-parameter binding strategy and answers, for a given run, whether any parameter still needs its provider metadata learned.
public sealed class QueryParameters : IDbParamCache
- Inheritance
-
QueryParameters
- Implements
- Inherited Members
- Extension Methods
Constructors
QueryParameters(int, SpecialHandler[])
Starts with every parameter unsettled, its binding inferred until a run teaches it more.
public QueryParameters(int NbNormalVariables, SpecialHandler[] specialHandlers)
Parameters
NbNormalVariablesintspecialHandlersSpecialHandler[]
Properties
SpecialHandlers
The special handlers, the ones that expand into several parameters.
public ReadOnlySpan<SpecialHandler> SpecialHandlers { get; }
Property Value
VariablesInfo
The binding strategy learned for each plain parameter.
public ReadOnlySpan<DbParamInfo> VariablesInfo { get; }
Property Value
Methods
IsCached(int)
Whether the parameter at ind already has a settled binding strategy.
public bool IsCached(int ind)
Parameters
indint
Returns
NeedToCache(object?[])
Whether this run uses a parameter whose provider metadata is not settled yet, so the command still has something to learn on this pass.
public bool NeedToCache(object?[] variables)
Parameters
variablesobject[]
Returns
Remarks
Every run asks this, and a command that has settled answers from the one read that finds the list empty.
NeedToCache(Span<bool>)
Whether this run uses a parameter whose provider metadata is not settled yet, so the command still has something to learn on this pass.
public bool NeedToCache(Span<bool> usageMap)
Parameters
Returns
Remarks
Every run asks this, and a command that has settled answers from the one read that finds the list empty.
Reset()
Returns every learned or manually pinned parameter strategy to the current inferred default. The next run relearns provider metadata for each parameter it uses.
public void Reset()
UpdateCache(int, DbParamInfo)
Pins the binding strategy for the parameter at ind.
public bool UpdateCache(int ind, DbParamInfo info)
Parameters
indintinfoDbParamInfo
Returns
UpdateCachedIndexes()
Refreshes the split between settled and unsettled parameters after a round of learning.
public void UpdateCachedIndexes()
UpdateSpecialHandlers<T>(T)
Offers infoGetter to the special handlers that have not settled yet, so each can
work out its own binding from the provider's metadata.
public bool UpdateSpecialHandlers<T>(T infoGetter) where T : IDbParamInfoGetter
Parameters
infoGetterT
Returns
Type Parameters
T