orderBy with variable column
Hey all!
I'd like to explore the possibility to order a query by one of it's columns, but the column itself is inferred from a variable.
What i've tried:
but no sort is applied.
Even using
does not change the final result.
Any idea?
Thanks in advance!
5 Replies
Can you pass
{ logger: true }
to drizzle config and share what is the query that's generated?Here the result, base on a real world query
Query: select "id", "name", "order" from "categories" order by ? asc limit ? -- params: ["name", 25]
Solution
Try that
Your solution works! a lot!