-
Notifications
You must be signed in to change notification settings - Fork 286
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
Expose raw values for parameters, before serialization #140
Labels
enhancement
New feature or request
Comments
@porsager we discussed this in gitter but after that I don't see any commits that address this. That's why decided to create an issue, just to keep this in repo |
Hi @stalniy Good thing you created an issue so we don't loose track of it ;) - And sorry for the late reply. I think it's a good point, and we should get it fixed for v2. |
stalniy
added a commit
to stalniy/postgres
that referenced
this issue
Mar 29, 2021
stalniy
added a commit
to stalniy/postgres
that referenced
this issue
Mar 29, 2021
porsager
pushed a commit
that referenced
this issue
Apr 5, 2021
* feat: adds `raw` property to error and debug parameters Fixes #140 * fix(types): adds `null` as additional type to `Parameter.raw` and `Parameter.value`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To illustrate what I mean (silly example that generates error):
This query fails because of typo and the error has
parameters
property. When I check this property, I see this:I understand that this is serialized parameters with their data types in Postges but this is not what I passed to
sql
function. So, it's not fine to log something like this into log file (or even in stack trace) because it confuses. I also cannot map values tovalue
property because then it looks like I passed string'1'
to id but I passed a normal number. This becomes even more confusing when we deal with booleans and the value equals tof
ort
debug
option behaves the same way, I'd like to have a way to get back parameters I passed tosql
function without writing additional logic on my end to unserialize all of thoseThe text was updated successfully, but these errors were encountered: