-
Notifications
You must be signed in to change notification settings - Fork 155
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
Promise callback with queryConfig options. #337
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.
Thanks for the contribution @nmaves! Any chance you could add a unit test to verify this behavior when capturing a query with a promise-based callback? Also, what would the 2nd argument be then in this case?
Honestly, I am not sure how to write this with your current test setup. From my testing that second argument is null. I put in debug statements with your code and found that to be the case. |
That's fair enough, I'd be fine with not having a unit test here if there was some validation to check if the 3rd argument is a function. Something similar to what we already do on L45: https://github.com/aws/aws-xray-sdk-node/blob/master/packages/postgres/lib/postgres_p.js#L45 |
Does that work? |
Looks like the test is failing because you need to include |
…romise callback is the 3 element in the args.
The test is now passing. |
Great, thanks again for the changes! |
hey @willarmiros you guys think you might snap a release anytime soon to get this out in the wild? |
We're definitely due for a release, I'll prioritize one soon. Thanks for the ping @nmaves ! |
@willarmiros don't make me beg and look like a need open source abuser :) |
Resolves #335
When you execute a PG query with an QueryConfig object the implicit promise callback is the 3 element in the args.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.