sqlite_orm icon indicating copy to clipboard operation
sqlite_orm copied to clipboard

Feature Request for OVER clause [Window function ?]

Open k03rdt6 opened this issue 5 years ago • 2 comments

Hello mate Is there a possibilty of OVER cluse support in Lib may be it already exist and I overlooked. I was trying to achive my pagination logic and needed to use OVER cluase with limit. my sql logic may be off in this regard but I was trying to achive something like this

select id,firstName,lastName,count(id) OVER() from user_profile order by id limit 50;

it just saves me trouble of writing seperate query for just a count when i add multiple conditions I am pretty sure this could be achived by left join or somthin similar or I could be shootin blind here

cheers.

k03rdt6 avatar Mar 07 '20 00:03 k03rdt6

Hello. This is a good feature request cause WINDOW functions are very powerful but noone before requested it. Could you provide a query you desire to execute please? It will help me very much

fnc12 avatar Mar 07 '20 08:03 fnc12

Thanks for quick reply This is from test code if you want detailed one i can post that too but it would be bloated for this instance don't you think ?

select id,firstName,lastName,count(id) OVER() from user_profile where id >(:refId) and order by id limit (resultperpage); Just a hunch it would not be possible to implement this feature in get_all because of class bindings and all

k03rdt6 avatar Mar 07 '20 12:03 k03rdt6