Cursor which buffers results
By default MySQLCursor is reading the result set, the programmer is responsible for reading or fetching all rows. However, it would be good to offer the programmer possibility to buffer the results right away. The fetch methods of the cursor would then read rows locally, and not directly from the network.
Possible use is for example a rather big result set, and the Python application need to do some calculation or operation which could take a while. This way, the MySQL server can release resources right away.
Blueprint information
- Status:
- Complete
- Approver:
- Geert JM Vanderkelen
- Priority:
- Undefined
- Drafter:
- Geert JM Vanderkelen
- Direction:
- Needs approval
- Assignee:
- Geert JM Vanderkelen
- Definition:
- Approved
- Series goal:
- Accepted for trunk
- Implementation:
- Implemented
- Milestone target:
- 0.1.0
- Started by
- Geert JM Vanderkelen
- Completed by
- Geert JM Vanderkelen
Related branches
Related bugs
Sprints
Whiteboard
MySQL.connect() gets a new argument 'buffered'
* True: rows are read during execution of SQL statement
* False: rows are retrieved when cursor's fetch methods are called
MySQLCursorBuffered inherits from MySQLCursor:
* the execute() method should get rows and store it in self._rows
* the .fetch*() methods should use the self._rows variable