https://www.prisma.io/ logo
#orm-help
Title
# orm-help
k

Kenny Tran

09/22/2022, 8:45 PM
Hey again, how would you guys handle fetching large amount of data? Let's say I want to fetch 100K users from my database and export their data. What's the best way to do it?
👀 1
1
k

Kevin Lanthier

09/22/2022, 9:50 PM
you could use
findall()
in small batches (eg. 5000 at a time) and paginate until you went through the whole thing
j

Jarupong

09/23/2022, 3:14 AM
I can say Prisma does not support stream data now. in my experience I was using https://github.com/brianc/node-postgres/tree/master/packages/pg-query-stream to get large data
n

Nurul

09/23/2022, 3:57 PM
Do you want to fetch all 100K records in one go? You could use pagination to get records in batches.
k

Kenny Tran

09/23/2022, 4:00 PM
Pagination it is, thanks 👍
🙌 1
3 Views