querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

Question about converting Offset to accept long instead of int

Open atdimitrov opened this issue 2 years ago • 1 comments

Hello.

I have a use case where I have to generate select query with offset bigger that int.MaxValue. As said in https://github.com/sqlkata/querybuilder/issues/298 int is sufficient for almost all cases, but not all. While I mostly agree with that statement for Limit, because it is rather rare for someone to attempt to read over 2 billion rows at once, the case is rather different when it comes to Offset.

Apart from the slightly higher memory usage, I don't see any disadvantages to making this API take long instead of int. Of course I'm don't have domain knowledge about the library, so I may be missing something. Do you, guys, see anything that would make such a change unfeasable or undesirable?

atdimitrov avatar Oct 13 '21 17:10 atdimitrov

Hi @atdimitrov, no actually I don't see any disadvantage for this, but I really consider this is a rare case, I appreciate some feedback from the community here, but anyway, I really think cursor based offsetting is better when you have a very large number of rows to skip, something like where Id > X

ahmad-moussawi avatar Feb 10 '22 21:02 ahmad-moussawi

Feature add #608 thanks for your feedback, will be available in the next major release due to breaking change

ahmad-moussawi avatar Sep 10 '22 17:09 ahmad-moussawi