You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "postgres-array" feature is not taken into account when generating Eq derives.
This causes the CLI to derive Eq for models containing Vec<f64> which will result in the following compilation error:
error[E0277]: the trait bound `f64: std::cmp::Eq` is not satisfied
--> app\src\entities\sensor.rs:17:5
|
6 | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
| -- in this derive macro expansion
...
17 | pub parameter_value: Vec<f64>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `f64`
Steps to Reproduce
create the following table in a postgres database:
createtablesensor (
id uuid primary key default gen_random_uuid(),
parameter_value double precision[] not null
);
enable the "postgres-array" feature in Cargo.toml
sea-orm = { version = "0.10", features = [
"sqlx-postgres",
"runtime-tokio-native-tls",
"macros",
"postgres-array",
] }
Run sea generate entity to generate the entities
Check/compile the project
Expected Behavior
This should compile, no Eq derive on the "sensor" Model.
Actual Behavior
This does not compile, there is a Eq derive on the "sensor" Model.
Reproduces How Often
Always
Versions
sea-orm 0.10.0
sea-orm-cli 0.10.0
Additional Information
The Eq derive was added in this PR but the logic does not take into account floats inside Vecs #988
The text was updated successfully, but these errors were encountered:
Description
The "postgres-array" feature is not taken into account when generating
Eq
derives.This causes the CLI to derive
Eq
for models containingVec<f64>
which will result in the following compilation error:Steps to Reproduce
sea generate entity
to generate the entitiesExpected Behavior
This should compile, no
Eq
derive on the "sensor" Model.Actual Behavior
This does not compile, there is a
Eq
derive on the "sensor" Model.Reproduces How Often
Always
Versions
sea-orm 0.10.0
sea-orm-cli 0.10.0
Additional Information
The
Eq
derive was added in this PR but the logic does not take into account floats insideVec
s #988The text was updated successfully, but these errors were encountered: