Brendonovich / prisma-client-rust

Type-safe database access for Rust
https://prisma.brendonovich.dev
Apache License 2.0
1.76k stars 104 forks source link

Data structs don't derive PartialEq #280

Closed liamwh closed 1 year ago

liamwh commented 1 year ago

It would be fantastic if structs could derive PartialEq if possible for those structs

https://youtu.be/Nzclc6MswaI

Brendonovich commented 1 year ago

I'm not sure I want to do this - especially since two records could be equal but have different relations fetched on them, making the derive(PartialEq) think they're equal. Manually implementing it to only compare relations if they have been fetched for both models could work? Still not sure I'm onboard though - Comparing entire db rows for equality seems kinda ill-advised and isn't something that diesel or sqlx support with their types.

Brendonovich commented 1 year ago

Not going to implement this