@Profiler.profile
def test_core_fetchmany_w_streaming(n):

    with engine.connect() as conn:
        result = conn.execution_options(stream_results=True).\
            execute(Customer.__table__.select().limit(n))
        while True:
            chunk = result.fetchmany(10000)
            if not chunk:
                break
            for row in chunk:
                data = row['id'], row['name'], row['description']
Load Core result rows using fetchmany/streaming.
dataset/ETHPy150Open zzzeek/sqlalchemy/examples/performance/large_resultsets.py/test_core_fetchmany_w_streaming