You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is some inconsistent behaviour when using the sqls.orderBy syntax
Example current
The code
val sorting: SQLSyntax = (params.sortBy, params.sortDirection) match {
case (Some("name"), Some("asc")) => sqls.orderBy(D.name, D.id).asc
case (Some("name"), Some("desc")) => sqls.orderBy(D.name, D.id).desc
[...]
}
The SQL statement
ORDER BY device.name, device.id ASC
ORDER BY device.name, device.id DESC
The implicit meaning
ORDER BY device.name ASC, device.id ASC
ORDER BY device.name ASC, device.id DESC
Example broken
val sorting: SQLSyntax = (params.sortBy, params.sortDirection) match {
case (Some("name"), Some("asc")) => sqls.orderBy(D.name).asc.orderBy(D.id).asc
case (Some("name"), Some("desc")) => sqls.orderBy(D.name).desc.orderBy(D.id).desc
[...]
}
The corrupt SQL statement
ORDER BY device.name ASC, ORDER BY device.id ASC
ORDER BY device.name DESC, ORDER BY device.id DESC
Summary
There is currently no good way to write a multi-orderBy, unless you'll just write it as a string. Ideally, you can define multiple orderBy items who are then processed into one ORDER BY sql statement
The text was updated successfully, but these errors were encountered:
There is some inconsistent behaviour when using the sqls.orderBy syntax
Example current
The code
The SQL statement
The implicit meaning
Example broken
The corrupt SQL statement
Summary
There is currently no good way to write a multi-orderBy, unless you'll just write it as a string. Ideally, you can define multiple orderBy items who are then processed into one ORDER BY sql statement
The text was updated successfully, but these errors were encountered: