Skip to content

ConnectionOptions interface is incompatible with @types/pg definitions #2637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jameshfisher
Copy link

Using pg-connection-string with @types/pg currently results in a type error like this:

Argument of type 'ConnectionOptions' is not assignable to parameter of type 'PoolConfig'.
  Types of property 'database' are incompatible.
    Type 'string | null | undefined' is not assignable to type 'string | undefined'.
      Type 'null' is not assignable to type 'string | undefined'.ts(2345)

See clashing definition: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/08f0feedca9329fe95d23ccc64886e3db03195bf/types/pg/index.d.ts#L18

Using pg-connection-string with @types/pg currently results in a type error like this:

    Argument of type 'ConnectionOptions' is not assignable to parameter of type 'PoolConfig'.
      Types of property 'database' are incompatible.
        Type 'string | null | undefined' is not assignable to type 'string | undefined'.
          Type 'null' is not assignable to type 'string | undefined'.ts(2345)

See clashing definition: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/08f0feedca9329fe95d23ccc64886e3db03195bf/types/pg/index.d.ts#L18
@hjr3 hjr3 self-requested a review April 11, 2025 10:22
@hjr3 hjr3 self-assigned this Apr 11, 2025
@hjr3
Copy link
Collaborator

hjr3 commented Apr 11, 2025

There are more problems with having ConnectionOptions match ClientConfig. See #2280

We landed #3128 to remedy this issue. Please let me know if you are still having problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants