DefinitelyTyped / DefinitelyTyped/DefinitelyTyped

[@types/pg] functions `escapeLiteral` and `escapeIdentifier` missing from base `"pg"` module

Open Beginner friendly
#68,050 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51.4k
Forks
30.4k
Avg merge
3d 21h
Merged PRs (30d)
108

Description

@types/pg has type detentions for escapeLiteral and escapeIdentifier on the ClientBase object, but not exported from the base pg module.

The pg docs recommend importing these functions directly from pg. Additionally, the pg source code states:

  // escapeIdentifier and escapeLiteral moved to utility functions & exported
  // on PG
  // re-exported here for backwards compatibility

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 in types/pg/index.d.ts around the ClientBase declarations and compare the module's exports with the pg utility-functions documentation and referenced client.js source. Done means TypeScript consumers can import escapeLiteral and escapeIdentifier directly from the base pg module with matching declarations.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, typescript
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.