-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to use sqlx::Type
with more complex scalar types?
#1493
Comments
sqlx::Type
with more complex scalar typessqlx::Type
with more complex scalar types?
This seems more appropriate for the Q&A section of the discussions than an issue. |
Makes sense, can someone with mod rights move it please? |
"Moving" it only copy-pastes it and and closes the issue, so you can do that too ;) |
Does it? I swear I've been redirected to discussions before that were originally issues. In any case, I can re-create this as a discussion. |
I have a Rust type that consists of multiple fields, in particular it looks like this:
This type has a
Display
andFromStr
implementation and hence can represent itself as a single scalar value. I would like to store this value in the database using its string representation AND use this type directly within SQL queries (which means sqlx needs to know how to handle it).What is the best way of supporting this? Perhaps this would work?
The text was updated successfully, but these errors were encountered: