Closed untidy-hair closed 1 year ago
Additional work is going on to cover cases I can think of.
Thanks for the PR, if you let me know when you think it's ready I'll do a full review.
Hi @thommor , thanks for the offering! I think this PR is ready for review.
I've just left one comment, but overall I like this addition.
I need to go through and overhaul this project like setting up releases into PyPi etc, which I will plan to do next week. Happy to merge this before then but I probably won't push a new version to pypi until I've done my side.
Thanks for the review! Updated the var name per suggestion. The plan of the new version sounds good to me π
Solves #44
On a second thought, maybe it's easier to be able to see diffs than just the whole Gist file so I'm creating this PR as a draft for discussions π
TODO:
[EDIT] Just for convenience, I'm copying some contents from #44
π First of all, thank you for this awesome library! I encountered this None/Null issue at my workplace (modified) where the last object of the previous page has NULL value for one of the ordering keys.
ERROR: invalid input syntax for type smallint: "None" at character 1564
... AND ("product"."tier" > 'None' OR ("product"."tier" = 'None' AND "product"."id" > '555'))) ORDER BY "product"."tier" ASC, "product"."id" DESC LIMIT 101
I made a patch and that is working for me but now I am trying to update this library, so I can use it as a regular library.
Whether Null comes at the beginning or at the end of the order is DB dependent. In that sense, my implementation there is a little bit opinionated for always putting NULL at the end (except when "last" exists). I personally cannot think of any reasons why NULL should come first but that can be configurable, too, if we like. (Caveat on README should be updated with this)