-
Notifications
You must be signed in to change notification settings - Fork 314
Open
Description
I propose support AsyncDisposable
on postgres.Sql
(https://github.com/tc39/proposal-explicit-resource-management) so that developers can opt-into ending the connection automatically at the end of the current scope.
before
import postgres from "postgres";
const sql = postgres();
const result = await sql`SELECT * FROM some_table`;
console.log(result);
await sql.end();
after
import postgres from "postgres";
await using sql = postgres();
const result = await sql`SELECT * FROM some_table`;
console.log(result);
Metadata
Metadata
Assignees
Labels
No labels