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

Method execute

src/remote/sqlserver/engine.ts:108–120  ·  view source on GitHub ↗
(
    dsl: string,
    options?: ExecutionOptions,
    signal?: AbortSignal
  )

Source from the content-addressed store, hash-verified

106 }
107
108 async execute<T = Record<string, unknown>>(
109 dsl: string,
110 options?: ExecutionOptions,
111 signal?: AbortSignal
112 ): Promise<ExecutionResult<T>> {
113 if (!this.pool) throw new Error('No data loaded. Please call source() first.');
114 throwIfAborted(signal);
115 const query = await this.dialect.validateDSL(dsl);
116 // query() uses sp_executesql, which restores SET options on return.
117 const result = await this.runQuery<T>(`SET ROWCOUNT ${maxRows(options) + 1};\n${query}`, signal);
118 const schema = queryColumns(Object.values(result.recordset.columns));
119 return executionResult(result.recordset, schema, options);
120 }
121
122 async dispose(): Promise<void> {
123 const pool = this.pool;

Callers

nothing calls this directly

Calls 5

throwIfAbortedFunction · 0.90
maxRowsFunction · 0.90
executionResultFunction · 0.90
queryColumnsFunction · 0.85
validateDSLMethod · 0.65

Tested by

no test coverage detected