-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow using complex types in try_from
when deriving FromRow
#2115
Allow using complex types in try_from
when deriving FromRow
#2115
Conversation
@95ulisse current development is on the |
7e87900
to
dc3f7fe
Compare
7e244d6
to
0e35590
Compare
@abonander I've just rebased my PR on top of |
@95ulisse can you amend and force-push to trigger a Github Actions run? |
…(try_from = "...")]`
0e35590
to
6a3cba1
Compare
@abonander Done 👍 The workflow is now pending approval. |
@abonander I fixed the tests and they are green on my machine. Could you re-run the workflow when you have some time, please? 🙏 |
…chbadge#2115) * Use `syn::Type` instead of `syn::Ident` to parse the value of `#[sqlx(try_from = "...")]` * Fix broken test after rebase
* Use `syn::Type` instead of `syn::Ident` to parse the value of `#[sqlx(try_from = "...")]` * Fix broken test after rebase
* Use `syn::Type` instead of `syn::Ident` to parse the value of `#[sqlx(try_from = "...")]` * Fix broken test after rebase
…chbadge#2115) * Use `syn::Type` instead of `syn::Ident` to parse the value of `#[sqlx(try_from = "...")]` * Fix broken test after rebase
Hello 👋
The new attribute
try_from
for theFromRow
derive introduced by #1081 expects the value oftry_from
to be a simple identifier instead of a full-fledged type. This means that that attribute cannot be used unless the referenced type is already in scope.This PR allows using complex types as the argument of
try_from
instead of just simple identifiers.