Hey all. Is Rank supported yet with Prisma? Quer...
# orm-help
p
Hey all. Is Rank supported yet with Prisma? Query
Copy code
select id, name, filterType, RANK() OVER (PARTITION BY filterType order by name asc) type_rank from DamFile;
Result:
Copy code
+----------------------------+------------------+------------+-----------+
| id                         | name             | filterType | type_rank |
+----------------------------+------------------+------------+-----------+
| 01FEP11SA9RM3YGQAKTQGKQB2Y | Folder 1         | folder     |         1 |
| 01FEP0VMFZ88YP495J17SG6SN2 | exif_image1.jpg  | image      |         1 |
| 01FEP0VMGSF5TN5QK7V15BMYB0 | exif_image10.jpg | image      |         2 |
Thanks
r
Not yet, you need to use raw queries for all window functions including
rank
. There’s a feature request for the same here that you can add a 👍 to.
p
Thanks for pointing me to the issue. I commented. Unfortunately I can't use a raw query, as the actual query is a complex object using Prisma natively. I just threw up that example to convey the question. I'm really spoiled by what Prisma can do. No worries, I'll figure another way out.
💯 1