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