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
I have encountered an issue that seems to affect Table::all / all_paginated/ stream-all / stream_all_paginated / get_many. There appears to be no way currently to specify the order of the results and the order varies after updates or inserts, this makes the paginated functions not too useful. If I am mistaken could the documentation be changed to show how.
I am using postgres but as SQL does not guarantee an ordering for a select, this would apply to all databases. Sql standard states "If an is not specified, then the ordering of the rows of Q is implementation-dependent."
Would there be a way to specify at the Table level an "order by"
#[ormx(table = "...",order="id asc")]
or for several
#[ormx(table = "...",order="firstname asc, lastname asc")]
or if not then could you add an example to do order by, offset and limit using the conditional_query_as macro, and maybe clarify in the methods mentioned that the order is not guaranteed.
Thanks
The text was updated successfully, but these errors were encountered:
That's a good point!
So I think that ORDER BY id DESC would be an appropriate default ordering, but there needs to be a way of changing that.
Will work on this in the near future.
Firstly, thanks for a useful crate.
I have encountered an issue that seems to affect Table::all / all_paginated/ stream-all / stream_all_paginated / get_many. There appears to be no way currently to specify the order of the results and the order varies after updates or inserts, this makes the paginated functions not too useful. If I am mistaken could the documentation be changed to show how.
I am using postgres but as SQL does not guarantee an ordering for a select, this would apply to all databases. Sql standard states "If an is not specified, then the ordering of the rows of Q is implementation-dependent."
Would there be a way to specify at the Table level an "order by"
#[ormx(table = "...",order="id asc")]
or for several
#[ormx(table = "...",order="firstname asc, lastname asc")]
#[ormx(get_many,order="firstname asc, lastname asc"))]:
or if not then could you add an example to do order by, offset and limit using the conditional_query_as macro, and maybe clarify in the methods mentioned that the order is not guaranteed.
Thanks
The text was updated successfully, but these errors were encountered: