sfackler / rust-postgres

Native PostgreSQL driver for the Rust programming language
Apache License 2.0
3.42k stars 436 forks source link

error[E0277]: the trait bound `Uuid: ToSql` is not satisfied - Rust dependency issue #1089

Closed Chanchal1233 closed 8 months ago

Chanchal1233 commented 8 months ago

getting these two errors when compiling:

error[E0277]: the trait bound Uuid: ToSql is not satisfied

error[E0277]: the trait bound NaiveDateTime: ToSql is not satisfied

my dependency setup:

[package] name = "warehousrManagementService" version = "0.1.0" edition = "2021"

[dependencies] actix-web = "4" tokio = { version = "1", features = ["full"] } tokio-postgres = "0.7.2" chrono = { version = "0.4.19", features = ["serde"] } serde = "1.0" serde_derive = "1.0" uuid = { version = "0.8.2", features = ["v4", "serde"] } serde_json = "1.0.64"

New to rust would really appreciate the help. Thanks.

sfackler commented 8 months ago
tokio-postgres = { version = "0.7.2", features = ["with-uuid-0_8"] }
cuyler commented 4 months ago

Just in case someone runs across this in 2024+:

tokio-postgres = { version = "0.7.10", features = ["with-uuid-1"] }