/
krasninja
/
querycat
Обзор
Документация
Войти
/
krasninja
/
querycat
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/QueryCat.Backend/Commands/Select/SelectCommand.cs
24 строки
821 B
Ivan Kozhin
Decouple Commands module from Execution module
17 янв 2024, 14:35
17 янв 2024, 14:35
7f59e20
Код
Авторство
О чём код?
using QueryCat.Backend.Ast; using QueryCat.Backend.Ast.Nodes; using QueryCat.Backend.Ast.Nodes.Select; using QueryCat.Backend.Core.Execution; namespace QueryCat.Backend.Commands.Select; /// <summary> /// SELECT command. /// </summary> internal sealed class SelectCommand : ICommand { /// <inheritdoc /> public IFuncUnit CreateHandler(IExecutionThread<ExecutionOptions> executionThread, StatementNode node) { var selectQueryNode = (SelectQueryNode)node.RootNode; // Iterate by select node in pre-order way and create correspond command context. new SelectPlanner(executionThread).CreateIterator(selectQueryNode); var context = selectQueryNode.GetRequiredAttribute<SelectCommandContext>(AstAttributeKeys.ContextKey); return new SelectCommandHandler(context); } }