deptyped / prisma-extension-pagination

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

Add ability to stream data #30

Open deptyped opened 5 months ago

deptyped commented 5 months ago

For example, to iterate over all users:

const users = await prisma.user
  .paginate()
  .toStream({
    limit: 25, // batch size
  });

for await (const user of users) {
  console.log(user); // {id: 1, name: 'John Doe'}
}
KATT commented 5 months ago

https://github.com/etabits/prisma-cursorstream