Documentation Home
MySQL Connector/Python Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.7Mb
PDF (A4) - 0.7Mb


10.6.3 cursor.MySQLCursorBufferedRaw Class

The MySQLCursorBufferedRaw class inherits from MySQLCursor.

A MySQLCursorBufferedRaw cursor is like a MySQLCursorRaw cursor, but is buffered: After executing a query, it fetches the entire result set from the server and buffers the rows. For information about the implications of buffering, see Section 10.6.1, “cursor.MySQLCursorBuffered Class”.

To create a buffered raw cursor, use the raw and buffered arguments when calling a connection's cursor() method. Alternatively, to make all cursors created from the connection raw and buffered by default, use the raw and buffered connection arguments.

Example:

import mysql.connector

cnx = mysql.connector.connect()

# Only this particular cursor will be raw and buffered
cursor = cnx.cursor(raw=True, buffered=True)

# All cursors created from cnx2 will be raw and buffered by default
cnx2 = mysql.connector.connect(raw=True, buffered=True)