(
dsl: string,
options?: ExecutionOptions,
signal?: AbortSignal
)
| 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; |
nothing calls this directly
no test coverage detected