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
This commit adds behavior that internally tracks ascending/descending
state on expressions, expanding only when necessary. This makes it
possible to reverse queries by reversing each of the stored sort
descriptors.
let sorted = users.order(name)
// SELECT * FROM "users" ORDER BY "name"
let reversed = sorted.reverse()
// SELECT * FROM "users" ORDER BY "name" DESC
let rereversed = reversed.reverse()
// SELECT * FROM "users" ORDER BY "name" ASC
This also allows for more array-like access, including `last`:
users.last
// SELECT * FROM "users" ORDER BY "ROWID" DESC LIMIT 1
Signed-off-by: Stephen Celis <[email protected]>
0 commit comments