(code: string, options?: ExecutionOptions)
| 80 | } |
| 81 | |
| 82 | async execute<T = Record<string, unknown>>(code: string, options?: ExecutionOptions): Promise<ExecutionResult<T>> { |
| 83 | if (!this.data) { |
| 84 | throw new Error('No data loaded. Please call source() first.'); |
| 85 | } |
| 86 | |
| 87 | const validated = await this.dialect.validateDSL(code); |
| 88 | const result = await executeCode(structuredClone(this.data), validated); |
| 89 | const rows = (Array.isArray(result) ? result : [{ value: result }]) as T[]; |
| 90 | return executionResult(rows, inferQuerySchema(rows), options); |
| 91 | } |
| 92 | |
| 93 | async dispose(): Promise<void> { |
| 94 | this.data = null; |
nothing calls this directly
no test coverage detected