-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implementing ToSql for [u8;N] #3714
Conversation
Thanks for opening this PR. Could you add at least some minor text for the motivation of that PR. |
Hi sorry about that, I was editing the description and got distracted by other stuff. Just added it now |
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 update. The change itself looks good.
I would like to see a test for that in diesel_tests/tests/types.rs
just to have something for the future to assert that this impl is there.
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
Thank you! Waiting for the tests though |
It's configured in such a way that it only merges the PR if the test passes. I just allows me to not coming back for merging in a day or two if everything is fine. |
I'll come back to it this afternoon (failed test) |
Oh, right. It needs a similar impl like that one: diesel/diesel/src/type_impls/primitives.rs Lines 113 to 116 in 39829eb
(Although I'm not sure if the derive correctly handles const generics…) |
Head branch was pushed to by a user without write access
I'm not sure all of this is actually needed. I can also squash the commits into a single one to reduce noise. |
Hi thanks for developing and supporting diesel.
This PR would allow to bind slices of arbitrary size to queries (my specific usecase is raw queries). It's mostly for convenience to prevent having to reshape types prior to sending them to diesel.
An alternative would be to implement it for all the
T: AsRef<[u8]>
.