Skip to main content
Module

x/postgres/mod.ts>Pool#connect

PostgreSQL driver for Deno
Extremely Popular
Go to Latest
method Pool.prototype.connect
import { Pool } from "https://deno.land/x/postgres@v0.17.0/mod.ts";

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

import { Pool } from "./pool.ts";

const pool = new Pool({}, 10);
const client = await pool.connect();
await client.queryArray`UPDATE MY_TABLE SET X = 1`;
client.release();