()
| 113 | } |
| 114 | |
| 115 | async dispose(): Promise<void> { |
| 116 | const pool = this.pool; |
| 117 | this.pool = null; |
| 118 | this.sourceSchema = undefined; |
| 119 | try { |
| 120 | for (const request of this.requests) request.cancel(); |
| 121 | } finally { |
| 122 | this.requests.clear(); |
| 123 | await pool?.close(); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | private async runQuery<T = Record<string, unknown>>(query: string): Promise<IResult<T>> { |
| 128 | if (!this.pool) throw new Error('No data loaded. Please call source() first.'); |