Skip to content
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

Support for uuid::Uuid v >= 1.0.0 #902

Closed
onx2 opened this issue Apr 26, 2022 · 7 comments · Fixed by #907
Closed

Support for uuid::Uuid v >= 1.0.0 #902

onx2 opened this issue Apr 26, 2022 · 7 comments · Fixed by #907
Labels
question Further information is requested

Comments

@onx2
Copy link
Contributor

onx2 commented Apr 26, 2022

It looks like uuid just released version 1.0.0 and I tried switching and received this error:

the trait bound `uuid::Uuid: OutputType` is not satisfied
required because of the requirements on the impl of `OutputType` for `&uuid::Uuid`

on this struct I have with the derived SimpleObject

#[derive(SimpleObject, Serialize, Deserialize, Debug, FromDbModel)]
pub struct User {
    pub id: Uuid,
    pub email: String,
    ..
}

Two part question:

  1. Could I temporarily resolve this by not using SimpleObject?
  2. What would it take to support v1 of uuid / is this a good first issue for a Rust beginner?
@onx2 onx2 added the question Further information is requested label Apr 26, 2022
@sunli829
Copy link
Collaborator

What would it take to support v1 of uuid / is this a good first issue for a Rust beginner?

Yes, welcome. 😁

@onx2
Copy link
Contributor Author

onx2 commented Apr 27, 2022

Cool, I can give it a shot when I get back home from vacation. Any pointers on what this might take / where to start?

@sunli829
Copy link
Collaborator

I guess just need to update the uuid version and then fix possible compile errors.

@cynecx
Copy link
Contributor

cynecx commented May 2, 2022

Can we support both? There are still many crates that depend on < 1.0 and it might take a while until the ecosystem migrates to uuid 1.0 (Or at least support one of them by specifying a new feature like uuid-v1 and uuid-v0.8).

@semanser
Copy link

@sunli829 I'm still getting the same error with the async-graphql 4.0.0

Repro code: https://github.com/semanser/uuid-test

error[E0277]: the trait bound `Uuid: OutputType` is not satisfied
 --> src/main.rs:4:10
  |
4 | #[derive(SimpleObject)]
  |          ^^^^^^^^^^^^ the trait `OutputType` is not implemented for `Uuid`
  |
  = note: required because of the requirements on the impl of `OutputType` for `&Uuid`
  = note: this error originates in the derive macro `SimpleObject` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Uuid: OutputType` is not satisfied
 --> src/main.rs:4:10
  |
4 | #[derive(SimpleObject)]
  |          ^^^^^^^^^^^^ the trait `OutputType` is not implemented for `Uuid`
  |
  = note: this error originates in the derive macro `SimpleObject` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `uuid-test` due to 2 previous errors

@cynecx
Copy link
Contributor

cynecx commented May 22, 2022

@semanser That's because the sqlx release you are on (0.5.x) is still using uuid-0.8.x:

https://github.com/launchbadge/sqlx/blob/6be16b4d1b55b20985b8b762956ab443f9481c3d/sqlx-core/Cargo.toml#L161

@semanser
Copy link

semanser commented May 22, 2022

@cynecx Ah, you're right. I was checking it on master and it uses 1.0 already... thanks!

launchbadge/sqlx#1821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants