/** * SQL Mode 2 — Executor * * Three-phase execution engine: * Phase 1: Parse + Plan (done before executor) * Phase 2: Resolve Dependencies (subqueries, CTEs) * Phase 3: Build & Execute pipelines */ import type { ExecutionPlan, SqlMode2Result, WriteOperation } from './types.js'; import type { OperationReceipt } from '../types.js'; /** * Adapter interface for the executor — abstracts away the actual MongoDB calls. */ export interface SqlExecutorAdapter { aggregate(collection: string, pipeline: Record[]): Promise[]>; bulkWrite(collection: string, ops: WriteOperation[]): Promise; /** Mutable — set by executor after INSERT to scope last insert ID per instance. */ lastInsertId?: string; /** Guardrail config — passed from StrictDB instance */ guardrails?: { limitRequired: boolean; emptyFilter: boolean; nullComparison: boolean; }; } /** Get the last inserted ID for the given adapter (for LAST_INSERT_ID() function). */ export declare function getLastInsertId(adapter: SqlExecutorAdapter): string | undefined; /** * Execute a plan against a database adapter. */ export declare function executePlan(plan: ExecutionPlan, adapter: SqlExecutorAdapter, explain?: boolean): Promise; //# sourceMappingURL=executor.d.ts.map