prisma
prisma copied to clipboard
Sort by Enum Field(s) alphabetically
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
This seems to be possible on mysql as well