deptyped / prisma-extension-pagination

Prisma Client extension for pagination
https://npmjs.com/prisma-extension-pagination
MIT License
243 stars 18 forks source link

Raw query support #17

Open hoangtrung99 opened 1 year ago

hoangtrung99 commented 1 year ago

It's a great package, but it seems it can't be used with raw queries, is there any way to use it with raw queries, I think this is a necessity when doing pagination?

deptyped commented 1 year ago

Are you talking about raw sql queries? I'm not sure how to implement this reliably so it doesn't cause problems on complex queries. How do you expect it should work?

hoangtrung99 commented 1 year ago

I'm not sure about the API design, I hope using $queryRaw it can also be paginated 🙏

jamesmoss commented 7 months ago

We've been discussing this today in our office, if we could provide 2 queries to an API, one for calculating the total count and one for the actual pagination. The latter would need to take params for the current page/cursor.