Replies: 1 comment
-
I think that might be reasonable to do, although it's not clear where the bound should exactly come from. Especially the information about the SQL type is missing. We cannot just hardcode type mappings there as users can define their own types on both sides. What might work is to construct this type out of the target column, so something like (Beside that |
Beta Was this translation helpful? Give feedback.
-
Context
I would like to be able to write:
UpstreamProxyAuth
doesn't implementToSql
/FromSql
UpstreamProxyAuthEnc
doesProblem
I am unsure why
AsChangeset
doesn't complain, butInsertable
requires to bound the trait as:But this doesn't allow me to implement the plain text version since I don't want it to insertable.
Possible Solution
What I have seen other derive macros do is to add the trait bound on the generated implementation.
For example
Clone
:Now that might be hard for the macro to build, but maybe simple cases could be supported?
Beta Was this translation helpful? Give feedback.
All reactions