Table of Contents

Interface IQueryPlanner

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Builds and resets the execution plan behind a query command.

public interface IQueryPlanner
Extension Methods

Methods

GetFrom(Type, QueryCommand?)

Resolves the From source expression for a CLR type, reusing the plan of queryCommand when one is supplied.

FromExpression? GetFrom(Type srcType, QueryCommand? queryCommand)

Parameters

srcType Type

The CLR type to resolve the source for.

queryCommand QueryCommand

An existing command whose plan should supply the source, or null.

Returns

FromExpression

The resolved source expression, or null when the type has no mapping.

GetPreparedQueryCommand<TResult>(QueryCommand<TResult>, bool, bool, CancellationToken)

Compiles a query command into an executable prepared command, optionally caching the plan for reuse.

IPreparedQueryCommand<TResult> GetPreparedQueryCommand<TResult>(QueryCommand<TResult> queryCommand, bool createEnumerator, bool storeInCache, CancellationToken cancellationToken)

Parameters

queryCommand QueryCommand<TResult>

The query command to compile.

createEnumerator bool

Whether an enumerator over the rows should be created as part of preparation.

storeInCache bool

Whether the resulting plan should be stored in the plan cache.

cancellationToken CancellationToken

Cancels the compilation of the query.

Returns

IPreparedQueryCommand<TResult>

The compiled, executable prepared command.

Type Parameters

TResult

The result element type.

ResetPreparation(QueryCommand)

Clears the execution plan built for queryCommand, so it is compiled again on next use.

void ResetPreparation(QueryCommand queryCommand)

Parameters

queryCommand QueryCommand

The query command whose preparation should be reset.