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

Add support for nodejs mysql2 package in TypeScript definition #387

Open
thomaschaaf opened this issue Mar 10, 2021 · 3 comments · May be fixed by #676
Open

Add support for nodejs mysql2 package in TypeScript definition #387

thomaschaaf opened this issue Mar 10, 2021 · 3 comments · May be fixed by #676
Assignees
Labels

Comments

@thomaschaaf
Copy link

Currently per the TypeScript definition only the mysql package may be used. According to the issue #6 the mysql2 package is also supported.

@willarmiros
Copy link
Contributor

@thomaschaaf thanks for raising this issue, you're right mysql2 types should be supported for instrumentation in our type definitions as well. We are open to you adding a PR for this support otherwise I'll add it soon.

@codeinabox
Copy link

Any updates on this? I seem to have run into this issue, my code is

import mysql2 from 'mysql2'
import { captureMySQL } from 'aws-xray-sdk'

const mysqlCaptured = captureMySQL(mysql2)

Which results in the following type check error:

Types of property 'createConnection' are incompatible.
Type '{ (connectionUri: string): Connection; (config: ConnectionOptions): Connection; }' is not assignable to type '(connectionUri: string | ConnectionConfig) => Connection'.
Types of parameters 'connectionUri' and 'connectionUri' are incompatible.
Type 'string | ConnectionConfig' is not assignable to type 'string'.
Type 'ConnectionConfig' is not assignable to type 'string'.

@rrhodes rrhodes linked a pull request Aug 27, 2024 that will close this issue
@rrhodes
Copy link

rrhodes commented Aug 27, 2024

Hello, I've raised a PR to hopefully close this issue. Feedback welcome. Looks like the PR workflows require maintainer approval if anyone reading this has sufficient permissions, please?

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

Successfully merging a pull request may close this issue.

4 participants