MatteoGioioso / MatteoGioioso/serverless-pg

Expose a getter or access to _client in the ServerlessClient class

Open
#58 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
JavaScript
Stars
324
Forks
16
PR merge metrics
No merged PRs in 30d

Description

I'd like to use Zapatos, pg ORM, with the benefits of ServerlessClient.

https://jawj.github.io/zapatos/#sql-tagged-template-strings

To use Zapatos, the .run method requires a pg.Client or pg.Pool. ServerlessClient itself cannot satisfy the pg.ClientBase interface.

I've already successfully made queries with Zapatos by ignoring the type checker and passing ._client. However, I'd like to do this without using ts-ignore everywhere.

Contributor guide

Open the contributing guide

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 locating the ServerlessClient class and its _client field, then review how the client is exposed and typed. The change is complete when Zapatos' .run method can receive the underlying pg.Client or pg.Pool without using ts-ignore; no test file is named in the issue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.