()
| 120 | } |
| 121 | |
| 122 | async dispose(): Promise<void> { |
| 123 | const pool = this.pool; |
| 124 | this.pool = null; |
| 125 | this.sourceSchema = undefined; |
| 126 | try { |
| 127 | for (const cancel of this.cancelRequests) cancel(); |
| 128 | } finally { |
| 129 | this.cancelRequests.clear(); |
| 130 | await pool?.close(); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | private async runQuery<T = Record<string, unknown>>(query: string, signal?: AbortSignal): Promise<IResult<T>> { |
| 135 | if (!this.pool) throw new Error('No data loaded. Please call source() first.'); |