-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support capturing parameterized queries #159
Comments
Thanks for this issue, fantastic repro and discussion! Yup, I have not (yet) added other arguments to the hashing algorithm that tells queries apart. It shouldn't be too complicated to add it to the hashing system. Are you interested in sending a pull request doing that (You've already got the hard part done in the test case there!)? I'm more than happy to review something or send some pointers about where to look/what to alter... |
@jonkeane, I can give it a shot. I also would be more than happy about some pointers before going into it 😄 |
Oops, sorry this notification got lost in my inbox 🙈 As a first pass I would try expanding the hash function to include at least one more argument where you can put the parameters. Since we don't really care about the hash doing anything other than being unique, you could even do something like Lines 29 to 33 in 75e3ce0
and then for recording alter somewhere around: Line 206 in 75e3ce0
The recording bit is a little funny, the expression in and for reading alter somewhere around (which should be more straight forward): Line 54 in 75e3ce0
In case you don't already know about this: you can set |
Same here 🙈 😁 I will take a stab at it in the coming days or weeks, not sure when I got the time for it. But it doesn't sound to complex from your description - I feared it would be harder. Thanks for taking the time putting that together! |
Brief description of the problem
Currently parameters of e.g.
dbSendQuery
are not considered when storing the statement and its return value.When capturing two identical queries with different parameters only the result of the last query persists because the second capturing will overwrite the captured result of the first.
I've build a small test case - click me
Is there currently a way to have identical queries with different parameters and different captures?
The text was updated successfully, but these errors were encountered: