Interface IQueryPlanner
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
srcTypeTypeThe CLR type to resolve the source for.
queryCommandQueryCommandAn 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
queryCommandQueryCommand<TResult>The query command to compile.
createEnumeratorboolWhether an enumerator over the rows should be created as part of preparation.
storeInCacheboolWhether the resulting plan should be stored in the plan cache.
cancellationTokenCancellationTokenCancels the compilation of the query.
Returns
- IPreparedQueryCommand<TResult>
The compiled, executable prepared command.
Type Parameters
TResultThe 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
queryCommandQueryCommandThe query command whose preparation should be reset.