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

Method execute

src/remote/sqlserver/engine.ts:106–113  ·  view source on GitHub ↗
(dsl: string, options?: ExecutionOptions)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected