Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

User Prisma enums don't derive PartialEq #217

Closed
@styxpilled

Description

@styxpilled

Comparing enums generated from Prisma enums is currently a bit annoying since you can't compare them directly with ==, and matching them indents your code more.
I feel like they should derive PartialEq and Eq.

enum Stuff {
  ONE
  TWO
  THREE
}
if thing == Stuff::One /* binary operation `==` cannot be applied to type `prisma::Thing`  */ {
    // ...
}

Without it, the workaround is to use match or convert the values to a string with .to_string() and compare that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions