Table of Contents

Class QueryParameters

Namespace
Rinku.Querying
Assembly
Rinku.dll

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

NbNormalVariables int
specialHandlers SpecialHandler[]

Properties

SpecialHandlers

The special handlers, the ones that expand into several parameters.

public ReadOnlySpan<SpecialHandler> SpecialHandlers { get; }

Property Value

ReadOnlySpan<SpecialHandler>

VariablesInfo

The binding strategy learned for each plain parameter.

public ReadOnlySpan<DbParamInfo> VariablesInfo { get; }

Property Value

ReadOnlySpan<DbParamInfo>

Methods

IsCached(int)

Whether the parameter at ind already has a settled binding strategy.

public bool IsCached(int ind)

Parameters

ind int

Returns

bool

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

variables object[]

Returns

bool

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

usageMap Span<bool>

Returns

bool

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

ind int
info DbParamInfo

Returns

bool

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

infoGetter T

Returns

bool

Type Parameters

T