-
Notifications
You must be signed in to change notification settings - Fork 543
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
feat(mysql2): support Connection.execute #1028
feat(mysql2): support Connection.execute #1028
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks, @aptomaKetil, and congrats for the first contribution!
I'll keep the PR open for a day or so more for others to see and react to it.
Please sign the CLA.
Codecov Report
@@ Coverage Diff @@
## main #1028 +/- ##
==========================================
+ Coverage 95.91% 96.02% +0.11%
==========================================
Files 13 16 +3
Lines 856 1006 +150
Branches 178 206 +28
==========================================
+ Hits 821 966 +145
- Misses 35 40 +5
|
Edit: I see now that the
// execute(options, cb)
|
I thought in some versions of this |
The tests for execute all have assertions on the number of spans produced by the instrumentation, so this is covered. I'm unaware of any previous discussion around this. I've taken a brief look at the mysql2 source and as far as I can tell, query and execute are on completely different code paths. |
Thanks, @aptomaKetil and congrats for your first contribution! |
Which problem is this PR solving?
The current instrumentation for mysql2 does not track queries made with
Connection.execute
, which is the helper method for preparing and executing a statement.Short description of the changes
Since
Connection.query
andConnection.execute
have the same signature and response formats (where it matters), all the existing wrapper code can simply be reused.Tests for
Connection.query
andPool.query
have been mirrored for.execute
.Checklist
npm run test-all-versions
for the edited package(s) on the latest commit if applicable.