-
Notifications
You must be signed in to change notification settings - Fork 562
Closed
Description
This is a request for information and a possible feature request. I would like to be able to add an order-by clause with a parameter using the query builder DSL. E.g.,
mods = append(
mods,
qm.OrderBy("(topics.name ilike ?) desc, topics.name", searchString),
)Looking at the code on master, this doesn't seem to be supported yet. Another possibility would be to be able to escape the string before it's passed to OrderBy:
mods = append(
mods,
qm.OrderBy(fmt.Sprintf("(topics.name ilike %s) desc, topics.name", qm.Escape(searchString)),
)For this particular case, I would prefer to use the query builder rather than construct a raw query, as it makes it much easier to pick and choose what is to be added to the query.
Is there a recommended way of handling this situation?
Reactions are currently unavailable