-
-
Notifications
You must be signed in to change notification settings - Fork 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
SupportsReturningClause mysql #2535
Comments
I would like to take this issue as first contribution to Diesel. May I ask you @weiznich to assign it to me? |
@thecooldrop Feel free to submit a PR for this. I should probably add that I don't think that |
@weiznich Your comment is really confusing me since according to my analysis, given that
This can be further complicated and nested if type parameter of 'Ret' of given statement type is again merely implementation of Given the argumentation above, I would agree that complete documentation does not belong into I must add tho that contra argument to adding this would be an implication, that such comment would have to be added to all making use of Given the two ways of decision above I would rather pursue the second one. |
Just to confirm, |
@sgrif It seems like the |
Nope, you didn't miss anything. PostgreSQL is the only driver we support by default for which we can reasonably implement this method. I'm just using language which excludes MySQL instead of language which specifies PostgreSQL since there are other SQL databases for which this could be implemented, that Diesel doesn't support out of the box, but for which a third party crate could provide a driver |
Is there any guide on how to make a driver for such? I'm currently using MariaDB and it does kinda work but I lose support for |
@WildEgo Unfortunately we do not provide a guide how to implement a third party backend. I can outline some general steps you can follow to implement such a backend, but be warned that this is likely no easy task. |
If you can get me a bit of guiding light on how to test it in real time and stuff I'll gladly try to do it even tho I'm kinda just out of reading the basic guide on rust, if I can make it it's good experience and so it is if I don't |
@WildEgo Have a look at the |
Hi all,
|
@RfDzDeveloper As already written above: For the Mysql backend that's impossible to solve due to restrictions of the SQL implementation. For MariaDB we would need a new backend to support this. We would accept contributions there, but we as maintainer team do not plan to implement that in the near future. Repeating these kind of questions does not chaneg the answers. |
@alexwatever Please do not ping people to ask your questions. Otherwise: Feel free to open a PR against the websites to change this guide. I personally feel that it is already pretty clear that the getting started guide uses postgresql as database system. |
@weiznich Fair enough, I apologise. I've removed my comment. |
Problem Description
Following the get started guide step by step I was willing to run insert code with
mysql
.But I was constantly getting a compile error.
And eventually (after figuring out that
execute
doesn't return id 😄 ) I took a look at the doc and it seems to me currently it's impossible to run such code withmysql
since its supported only bypostgress
right?https://docs.diesel.rs/diesel/backend/trait.SupportsReturningClause.html
What are you trying to accomplish?
If it's true I would consider adding some information somewhere that it's not work with mysql could reduce peoples time spent on trying to resolve it. Probably in get_result doc comment.
Comment
I may be incorrect in my assumptions in which case I am sorry 😞
And thank you for the crate.
The text was updated successfully, but these errors were encountered: