MCPcopy Create free account
hub / github.com/antvis/AVA / execute

Method execute

src/interpreter/javascript/engine.ts:83–97  ·  view source on GitHub ↗
(
    code: string,
    options?: ExecutionOptions,
    signal?: AbortSignal
  )

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 5

throwIfAbortedFunction · 0.90
executeCodeFunction · 0.90
executionResultFunction · 0.90
inferQuerySchemaFunction · 0.90
validateDSLMethod · 0.65

Tested by

no test coverage detected