porsager / porsager/postgres

feat: support 'using' syntax and [Symbol.dispose]

Open
#886 0 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
8.7k
Forks
374
Avg merge
11d 16h
Merged PRs (30d)
1

Description

It would be great to be able to do:

{
   using client = postgres(...);
   // ... queries
}

and have client.end() be called automatically in [Symbol.dispose]. It's part of typescript (since 5.2) now and Stage 3 for TC39.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the client returned by postgres(...) and the existing client.end() lifecycle. Check how TypeScript 5.2 using syntax and [Symbol.dispose] are represented, then verify that block exit invokes disposal and closes the client without breaking existing usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, postgresql, typescript
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.