Write SQL query in Drizzle?
Hey! How to write a similar query in drizzle? Basically, I need a way to count the total number of pages in a single query (should I?) for offset pagination?
vs. what I found on stackoveflow:
Stack Overflow
How to count total number of rows when limit is added in android sq...
I am using SQLITE in android and I am having an issue I want to get the total count of row when limit is applied. For example if I apply limit of 100 for pagination but there are around 2000 data. ...
4 Replies
guuyss, help pls
Drizzle ORM - Select
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
thanks!
@Sillvva do you think this is more performant than the previous example? Because it counts for each user row. Thx!
I'm not sure which is more performant, but the CTE is a temporary result set which is stored in memory. My guess is that it would be faster than making two separate round trips to the db.