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
If you want my 2 cents on it - trying to support everything with some structure is fools errand. Structure is only needed to be able to manipulate unfinished query. How many people really need to pass around partially ordered query to be able to add more order on it?
So if we accept that one doesn't need to refine order then we can just recommend to use sql() for hard cases:
query.orderBy(sql('age desc, name collate Latin1_General_CI_AS'))
For simple cases current behavior is almost sufficient. The only case is simple direction flip is absent. Proposed .asc() and .desc() could do, but often when we decide on user input some parameterized method is better:
// .asc() and .desc()varquery=query.orderBy('name')args.asc ? query.asc() : query.desc()// order direction as param, chains betterquery.orderBy('name').orderDir(args.asc)// orquery.orderBy('name',args.asc)
My current thought (though I'm open on this) would be to support all the functionality via passing an array of objects to ORDER BY:
And to add .asc(), .desc() and .collate() convenience functions which augment the column most recently passed to .orderBy():
See #39 for more details.
The text was updated successfully, but these errors were encountered: