pg-mem icon indicating copy to clipboard operation
pg-mem copied to clipboard

Implementation of ROW_NUMBER

Open remithomas opened this issue 3 years ago • 4 comments

First thing first, this is beautiful tool, good job ! And thanks a lot !! 💪

To summarize I would like to use ROW_NUMBER in queries

  • I tried registerFunction but how to get the current index ? Maybe we could expose some informations as argument through implementation call
  • An other suggestion is we could add this psql function at the lower level in the lib ?

It could be use like this in the playground

-- ROW_NUMBER()
SELECT "user"."id" AS "user_id", "user"."name" AS "user_name", ROW_NUMBER() OVER (ORDER BY "id") FROM "user";

what do you think ?

thank you again Rémi

remithomas avatar Feb 09 '22 14:02 remithomas

Hi Rémi, Thanks !

Ouch... that not a simple function, so registerFunction() is not the right call here. This is quite tricky to implement. I dont have time to implement this right now unfortunately, but I'm adding that to my todolist, and I'll think about it.

oguimbal avatar Feb 10 '22 08:02 oguimbal

Any updates on this, or any workarounds I could try? 😀

HanSwinkels avatar Jun 23 '23 08:06 HanSwinkels

would really love to have support for ROW_NUMBER someday

currently we have some test cases that we xdescribe out and only run locally because we need to connect to a live running db instance

thatguyintech avatar Jan 22 '24 22:01 thatguyintech

+1 to this request. Having support for ROW_NUMBER would help alot ! 🤞

HussainAliAkbar avatar Mar 26 '24 12:03 HussainAliAkbar