Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport user-defined `FromSql` and `ToSql` implementations #348
Comments
This comment has been minimized.
|
I'm also wondering this. In my case, I want to use a custom type in a table struct that Diesel should treat as a String for all intents and purposes. It's not clear to me how to achieve this. I started out by trying to just implement ToSql for my type, but it seems like there is a rabbit hole of traits that need to be satisfied, cause I get errors like "diesel::Expression is not satisfied" and "diesel::Expression:NonAggregate is not satisfied." |
This comment has been minimized.
leoschwarz
commented
May 8, 2017
|
I have the same problem right now, apparently the situation has still not improved by much or I'm not able to find the relevant modules. (Also I think this and #162 are essentially duplicates.) |
This comment has been minimized.
|
Closing as a duplicate of #162. |
kardeiz commentedJun 1, 2016
It would be nice if it were easier to write one's own
FromSqlandToSqlimplementations.In my understanding (I could be wrong), this is actually possible—all the required traits, etc. are public—but all of the traits implemented by the
expression_implsandqueryable_implsmacros have to be written by hand, because these macros are not publicly exposed.Would it be possible to export these macros as well, or provide some other functionality to facilitate these conversions?