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

Method execute

src/interpreter/javascript/engine.ts:82–91  ·  view source on GitHub ↗
(code: string, options?: ExecutionOptions)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected