Skip to content
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

Use ClientConfig from pg #657

Merged
merged 3 commits into from
May 23, 2021
Merged

Use ClientConfig from pg #657

merged 3 commits into from
May 23, 2021

Conversation

brandonchinn178
Copy link
Contributor

Just use ClientConfig from pg instead of defining it explicitly. Getting a type error, since the ssl field in ClientConfig from pg is slightly different from the ssl field in here.

Type 'ClientConfig' is not assignable to type 'string | ClientConfig'.
  Type 'import(".../node_modules/@types/pg/index").ClientConfig' is not assignable to type 'import(".../node_modules/node-pg-migrate/dist/types").ClientConfig'.
    Types of property 'ssl' are incompatible.
      Type 'boolean | ConnectionOptions | undefined' is not assignable to type 'boolean | TlsOptions | undefined'.
        Type 'ConnectionOptions' is not assignable to type 'boolean | TlsOptions | undefined'.
          Type 'ConnectionOptions' is not assignable to type 'TlsOptions'.
            Types of property 'pskCallback' are incompatible.
              Type '((hint: string | null) => PSKCallbackNegotation | null) | undefined' is not assignable to type '((socket: TLSSocket, identity: string) => Uint8Array | DataView | Uint8ClampedArray | Uint16Array | Uint32Array | ... 5 more ... | null) | undefined'.
                Type '(hint: string | null) => PSKCallbackNegotation | null' is not assignable to type '(socket: TLSSocket, identity: string) => Uint8Array | DataView | Uint8ClampedArray | Uint16Array | Uint32Array | ... 5 more ... | null'.
                  Types of parameters 'hint' and 'socket' are incompatible.
                    Type 'TLSSocket' is not assignable to type 'string'.

@littlewhywhat
Copy link
Contributor

hey, @brandonchinn178 thank you for this PR! In general LGTM 👍

do you think you can rebase it on the latest master and run npm run build from the root and fix any errors that are shown there? at the moment the build fails. Thank you 🙏 If you don't have time for that please let me know.

@Shinigami92 just to check, you don't see any potential problems here? wondering why this PR stayed here for a year...

Copy link
Collaborator

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClientConfig from pg defines password as string | (() => string | Promise<string>)
This wont bring a breaking change into the project, but we may need to check if we need to support the non-string callback type

src/types.ts Outdated Show resolved Hide resolved
src/types.ts Show resolved Hide resolved
@brandonchinn178
Copy link
Contributor Author

@littlewhywhat @Shinigami92 Made all requested changes

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.

3 participants