sdispater / eloquent

The Eloquent ORM provides a simple yet beautiful ActiveRecord implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add chunk support for QueryBuilder

sdispater opened this issue · comments

The QueryBuilder class should support chunks to ease on memory consumption for large results sets:

with db.table('users').chunk(100) as users:
    for user in users:
        # ...

Actually, it will not be a context manager but rather a generator:

for users in db.table('users').chunk(100):
    for user in users:
        # ...