Replies: 1 comment
-
|
First of all: I'm sorry to let your proposal sit that long unanswered, it's just currently hard to get through all the issues, PR's and suggestions in a timely manner in the time I have to work on the project. That out of the way: I would be generally open to expose this. The proposed API looks mostly fine to me, although I would expect at least some tests + a bit of documentation. As for the actual implementation: I've added a bunch of comments to your commit, hopefully that's helpful. (It's mostly minor style suggestions instead problems with the implementation) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Backend
MySQL
What do you want to add to diesel?
There's a non-zero chance mysql queries have warnings. Expect in hand built queries or oddly configured servers. But there's no way to know:
SHOW WARNINGSandSELECT @@warning_countis not supported in prepared statements, running them inbatch_query/RawConnection::executethrows the result away.For reference, mysql Connector/python calls mysql_warnings_count() after every query. If any they SHOW WARNINGS then log or throw an exception. Connector/j has a similar system.
Implementation notes
I implemented a basic version with the non-prepared statement API. TheLQ@f67fabd
Calling after my questionable batch_query found real problems: data truncation because I wrote the LOAD DATA file wrong (dates aren't quoted, null is \N not NULL, oops...), duplicate primary keys from bad cleanup. Again before I had no errors and no logs only confusing table output.
Looking for feedback before submitting a PR: Is there interest in warnings checks? Would you want an automatic Err-on-warning like the connector clients or only explicit mysql_warnings_count() + SHOW WARNINGS? Any implementation suggestions styling wise?
Additional details
No response
Checklist
Beta Was this translation helpful? Give feedback.
All reactions