| 9 | | """ |
| 10 | | Yield blocks of rows from a cursor and ensure the cursor is closed when |
| 11 | | done. |
| 12 | | """ |
| 13 | | try: |
| 14 | | for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel): |
| 15 | | yield rows if col_count is None else [r[:col_count] for r in rows] |
| 16 | | finally: |
| 17 | | cursor.close() |
| | 9 | """ |
| | 10 | Yield blocks of rows from a cursor and ensure the cursor is closed when |
| | 11 | done. |
| | 12 | """ |
| | 13 | try: |
| | 14 | for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel): |
| | 15 | yield rows if col_count is None else [r[:col_count] for r in rows] |
| | 16 | finally: |
| | 17 | cursor.close() |