Replies: 1 comment 1 reply
-
Thanks for filling this feature request. As an intermediate solution: You can always match on the error returned by diesel to detect this case + ignore that error. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When updating a table with
diesel::update()
, you can easily get this error:Ok, so for a little struct like this:
, I just need to add a preliminary guard test, something like this:
But for a bigger struct it can become tedious.
What about adding a method like
has_changes()
to the traitAsChangeSet
, which would be automatically implemented when auto-deriving? It would returnfalse
when all the struct fields areNone
; or to be more precise, it would returnfalse
each time the error "There are no changes to save. This query cannot be built" would be triggered.I am really not aware of the ins and outs of such a question, but it would be really nice, to my user's point of view:)
What do think about it?
A related issue: #1996
Beta Was this translation helpful? Give feedback.
All reactions