refactor(exec): slim executor.nim to dispatcher + hook wiring

This commit is contained in:
2026-07-30 15:12:41 +03:00
parent a5976f648a
commit b282a59fb5
+4 -13
View File
@@ -8,18 +8,13 @@ import std/tables
import std/hashes import std/hashes
import std/sequtils import std/sequtils
import std/algorithm import std/algorithm
import std/re
import checksums/sha2
import std/math import std/math
import std/times import std/times
import std/json import std/json
import std/random
import std/monotimes
import std/locks import std/locks
import lexer as qlex import lexer as qlex
import parser as qpar import parser as qpar
import ast import ast
import ir
import ../core/types import ../core/types
import ../protocol/wire import ../protocol/wire
import ../storage/lsm import ../storage/lsm
@@ -33,10 +28,6 @@ import ../core/registry
import ../vector/engine as vengine import ../vector/engine as vengine
import ../graph/engine as gengine import ../graph/engine as gengine
import ../graph/community as gcomm
import ../ai/chunk as chunkmod
import ../ai/llm as llmmod
import ../graph/cypher as cyphermod
import exec/types import exec/types
import exec/values import exec/values
@@ -395,7 +386,6 @@ proc executeQueryImpl(ctx: ExecutionContext, astNode: Node, params: seq[WireValu
var expandedCols: seq[string] = @[] var expandedCols: seq[string] = @[]
var seenColNames = initTable[string, bool]() var seenColNames = initTable[string, bool]()
let fromTable = if stmt.selFrom != nil and stmt.selFrom.kind == nkFrom: stmt.selFrom.fromTable else: "" let fromTable = if stmt.selFrom != nil and stmt.selFrom.kind == nkFrom: stmt.selFrom.fromTable else: ""
let fromAlias = if stmt.selFrom != nil and stmt.selFrom.kind == nkFrom: stmt.selFrom.fromAlias else: ""
for c in cols: for c in cols:
if c == "*": if c == "*":
if fromTable.len > 0: if fromTable.len > 0:
@@ -1574,9 +1564,10 @@ proc executeMigrationSql(ctx: ExecutionContext, sql: string): ExecResult =
return okResult(msg="Empty migration body") return okResult(msg="Empty migration body")
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Hook wiring — eval.nim back-edges (subqueries, hybrid search, NL->SQL # Hook wiring — breaks the module cycle between executor and the exec/*
# validation). Resolved at module scope; stays valid when executePlan # submodules: eval.nim calls back into the engine for subqueries, hybrid
# moves to its own module in a later task. # search, and NL->SQL validation; triggers.nim executes trigger bodies.
# Wired once at module scope.
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
eval.executePlanHook = plan_exec.executePlan eval.executePlanHook = plan_exec.executePlan
eval.execScanHook = scan.execScan eval.execScanHook = scan.execScan