ebean icon indicating copy to clipboard operation
ebean copied to clipboard

SqlQuery setFirstRow fail - modify SQL using LIMIT/OFFSET etc to support firstRows/maxRows

Open icode opened this issue 11 years ago • 25 comments

Set the index of the first row of the results to return.

SqlQuery.setFirstRow(10) findList return first row index 0

icode avatar Apr 23 '15 05:04 icode

SqlQuery currently does not modify the SQL to add limit and offset or similar sql changes ... in order to support firstRows and maxRows.

I believe this is what you are asking for in this ticket. To change SqlQuery such that it supports firstRows/maxRows by modifying the SQL (like the Orm queries).

I think that is a somewhat reasonable request/change. Modifying the SQL is relatively simple enough for the LIMIT OFFSET case (MySql, Postgres) but might be more problematic to implement when 'window function' is used (Oracle etc). The big benefit of modifying the SQL is that it will generally be more performant (sometimes far more performant).

Assuming I have understand that correctly I'll adjust the title of this ticket to reflect the desired change.

rbygrave avatar Apr 24 '15 09:04 rbygrave

I think that is a somewhat reasonable request/change. I have a lot of other Sytem/Application table, like Stock , Industry and more 3rd table.I can't table refused to change, i can't build Model for table, so Modifying the SQL is relatively simple enough for the LIMIT OFFSET case (MySql, Postgres) is need for me

icode avatar Apr 24 '15 10:04 icode

Please can quickly support SQL paging?

Thanks!

icode avatar May 06 '15 07:05 icode

I don't know how quickly I can get to this. Working on documentation at the moment etc.

rbygrave avatar May 06 '15 08:05 rbygrave

:cry: When fix it? @rbygrave

icode avatar Dec 21 '15 09:12 icode

I'm not sure. There are various things ahead of this in terms of priorities but the list is getting smaller. It should be sorted by the end of Jan.

rbygrave avatar Dec 21 '15 18:12 rbygrave

I also need such features , looking forward to an early solution

archer-christ avatar Jan 14 '16 03:01 archer-christ

+1 :+1:

icode avatar Jan 15 '16 11:01 icode

waiting this basic feature @rbygrave help!

icode avatar Jan 20 '16 06:01 icode

which Milestone fixed it? @rbygrave

icode avatar Jan 29 '16 07:01 icode

It is not fixed. It is still open and no milestone associated.

rbygrave avatar Jan 29 '16 07:01 rbygrave

this no fix plan?

icode avatar Jan 29 '16 08:01 icode

start at 23 Apr 2015, Going a year :sob:

icode avatar Jan 29 '16 08:01 icode

@rbygrave This has been forgotten?

icode avatar Mar 08 '16 01:03 icode

No, its a case of complexity and priorities.

That is, the people that pay the bills get to dictate the priorities largely (90%) and secondly this issue is more complex that it seems (in order to support Oracle etc) - those 2 issues have pushed it down the priority list.

rbygrave avatar Mar 08 '16 02:03 rbygrave

Excuse me, not arrange it?

icode avatar Mar 25 '16 01:03 icode

I don't understand your last comment. Can you expand it?

rbygrave avatar Mar 25 '16 01:03 rbygrave

Sorry, I see have doing this?

icode avatar Mar 25 '16 01:03 icode

So the current plan for this issue is that I need to review Oracle's support for limit/offset (that came in with 12 I think?). That is, I am not keen on this only working for Postgres/MySql (or at least it will cause a lot of pain if this is not supported on Oracle as well).

Will some luck I should get to this in the next 2 weeks.

rbygrave avatar Mar 25 '16 02:03 rbygrave

em, now orm padding not use for this?

icode avatar Mar 25 '16 02:03 icode