-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
the trait bound uuid::Uuid: diesel::Expression is not satisfied #2348
Comments
Basically a duplicate of #1900. (You need to use the |
@weiznich thank for your answer. Now I'm using: [dependencies]
actix-web = "=2.0.0"
actix-rt = "=1.0.0"
chrono = { version = "=0.4.11", features = ["serde"] }
diesel = { version = "=1.4.4", features = ["postgres", "r2d2", "uuidv07", "chrono"] }
diesel_migrations = "=1.4.0"
dotenv = "=0.15.0"
env_logger = "=0.7.1"
lazy_static = "=1.4.0"
log = "=0.4.8"
r2d2 = "=0.8.8"
serde = "=1.0.105"
serde_json = "=1.0.50"
uuid = { version = "=0.8.1", features = ["serde", "v4"] } But Cargo gives me a warning:
|
We do not say that anywhere in our code, so I'm not sure where cargo is getting this information from. You should probably rise a issue there. |
|
In the issue tracker of whichever tool is giving you this warning. So if it's cargo itself then here: https://github.com/rust-lang/cargo/, if it's some custom subcommand in then in their issue tracker. |
FWIW, I am using diesel 1.4.5 with uuid 0.8.1 and adding the |
Second @problame's issue, the following dependencies and features don't work: diesel = {version = "1.4.4", features = ["chrono", "postgres", "r2d2", "uuid"]}
uuid = "0.8.2" But this does: diesel = {version = "1.4.4", features = ["chrono", "postgres", "r2d2", "uuidv07"]}
uuid = "0.8.2" |
Wow this should be reopened/ a new issue created. Same problem for me, was fixed by @gaku-sei 's solution |
I just had the same issue. The issue was also resolved by @gaku-sei 's solution. |
tl;dr More background: [dependencies]
actix-cors = "0.5.4"
actix-rt = "1.1.1"
actix-service = "1.0.6"
actix-web = "3.3.2"
bcrypt = "0.10.1"
chrono = { version = "0.4.19", features = ["serde"] }
derive_more = "0.99.11"
diesel = {version = "1.4.4", features = ["chrono", "postgres", "r2d2", "uuidv07"]}
diesel_migrations = "1.4.0"
dotenv = "0.15.0"
env_logger = "0.9.0"
# for heroku rust buildpack
libsqlite3-sys = { version = "0.22.2", features = ["bundled"] }
failure = "0.1.8"
futures = "0.3.12"
jsonwebtoken = "7.2.0"
log = "0.4.14"
serde = "1.0.123"
serde_derive = "1.0.123"
serde_json = "1.0.62"
# uuid = { version = "0.8.1", features = ["serde", "v4"]}
uuid = "0.8.2" The error reads:
Here is where went wrong: #[derive(Insertable)] // <- here
#[table_name = "history_signin"]
pub struct InsertableDTOHistorySignIn{
pub user_id: Uuid,
pub timestamp_signin: NaiveDateTime,
} |
Is there a trait impl we could add over in |
@KodrAus Thanks for reaching out here ❤️
That written: The uuid integration in diesel is really simple, as it's only a few lines of code. As long as the two function we are using are not changed in an incompatible way there is really not much maintained burden here. Having a stable uuid 1.0 release should really help there. |
I'm getting the trait 'diesel::Expression' is not implemented for 'uuid::Uuid' on 1.4.8 and uuid 8.2 with feature uuid in diesel. |
I fixed with using the diesel::*::Uuid type in schema and uuid::Uuid crate in model and my application. I also had to roll diesel back to 1.4.4 and use uuidv07 feature This is my Toml |
Thanks for the details @weiznich! Yeh, there's no way those |
@KodrAus Thanks for that information. Yes that's the plan to update the dependency to |
The solution referenced above works
note the |
Just a heads up @weiznich I'm running through that |
Shouldn't the |
@CuriousCI We don't plan to release any additional 1.4.x release at this point in time as we just don't have the resources to maintain more than one diesel version in parallel. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Got it, will do |
Versions
Cargo.toml
Problem Description
What are you trying to accomplish?
Use
uuid
withdiesel
with no problems.What is the expected output?
It works.
What is the actual output?
the trait bound uuid::Uuid: diesel::Expression is not satisfied
Are you seeing any additional errors?
Nope.
I saw:
But still problems, why?
Checklist
closed if this is not the case)
The text was updated successfully, but these errors were encountered: