* This will return a new client from the available connections in * the pool * * In the case of lazy initialized pools, a new connection will be established * with the database if no other connections are available * * ```ts * import { Pool } from "jsr:@db/postgres"; * const
()
| 128 | * ``` |
| 129 | */ |
| 130 | async connect(): Promise<PoolClient> { |
| 131 | // Reinitialize pool if it has been terminated |
| 132 | if (this.#ended) { |
| 133 | this.#ready = this.#initialize(); |
| 134 | } |
| 135 | |
| 136 | await this.#ready; |
| 137 | return this.#available_connections!.pop(); |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * This will close all open connections and set a terminated status in the pool |
no test coverage detected