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