Replies: 1 comment 2 replies
-
You can't use a custom expression here because ordering clauses are no expressions. Further, sqlite3 does not support the One option would be to map each enum to an int with query.orderBy(OrderingTerm.asc(
yourTable.status.caseMatch<int>(
when: {
for (var i = 0; i < YourEnum.values.length; i++)
Constant(YourEnum.values[i].toString()): Constant(i)
}
)
)) This will generate something like |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
I'm trying to sort my column "status" by ENUM type.
I tried to create and add a customExpression to my Moor's query (like in the script below).
But it didn't work.
I would know if it is possible to order a column by String without using customSelect().
Thanks
Beta Was this translation helpful? Give feedback.
All reactions