Sort by Enum Field(s) alphabetically #24120
Labels
domain/client
Issue in the "Client" domain: Prisma Client, Prisma Studio etc.
domain/schema
Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc.
kind/feature
A request for a new feature.
topic: enum
"type"/block `enum`
topic: orderBy / sorting
Problem
Today sorting by enum field(s) means order data by its integer value. There are cases when data needs to be ordered by the String defined by the enum
In PostGres this is possible through the modifier "::text", for example : ORDER BY myEnumField::text
Suggested solution
Associate a new SortOrderEnum class to enum fields, where a property sortMode can define if sort by Name or Value of the enum
The text was updated successfully, but these errors were encountered: