import { Pool } from "https://deno.land/x/denogres@v0.7.0-alpha/deps.ts";
This will close all open connections and set a terminated status in the pool
import { Pool } from "./pool.ts";
const pool = new Pool({}, 10);
await pool.end();
console.assert(pool.available === 0, "There are connections available after ending the pool");
await pool.end(); // An exception will be thrown, pool doesn't have any connections to close
However, a terminated pool can be reused by using the "connect" method, which will reinitialize the connections according to the original configuration of the pool
import { Pool } from "./pool.ts";
const pool = new Pool({}, 10);
await pool.end();
const client = await pool.connect();
await client.queryArray`SELECT 1`; // Works!
client.release();