class documentation

class BufferedRowCursorFetchStrategy(CursorFetchStrategy): (source)

View In Hierarchy

A cursor fetch strategy with row buffering behavior. This strategy buffers the contents of a selection of rows before ``fetchone()`` is called. This is to allow the results of ``cursor.description`` to be available immediately, when interfacing with a DB-API that requires rows to be consumed before this information is available (currently psycopg2, when used with server-side cursors). The pre-fetching behavior fetches only one row initially, and then grows its buffer size by a fixed amount with each successive need for additional rows up the ``max_row_buffer`` size, which defaults to 1000:: with psycopg2_engine.connect() as conn: result = conn.execution_options( stream_results=True, max_row_buffer=50 ).execute(text("select * from table")) .. versionadded:: 1.4 ``max_row_buffer`` may now exceed 1000 rows. .. seealso:: :ref:`psycopg2_execution_options`

Class Method create Undocumented
Method __init__ Undocumented
Method fetchall Undocumented
Method fetchmany Undocumented
Method fetchone Undocumented
Method hard_close Undocumented
Method soft_close Undocumented
Method yield_per Undocumented
Class Variable __slots__ Undocumented
Method _buffer_rows this is currently used only by fetchone().
Instance Variable _bufsize Undocumented
Instance Variable _growth_factor Undocumented
Instance Variable _max_row_buffer Undocumented
Instance Variable _rowbuffer Undocumented

Inherited from CursorFetchStrategy:

Method handle_exception Undocumented

Inherited from ResultFetchStrategy (via CursorFetchStrategy):

Class Variable alternate_cursor_description Undocumented
@classmethod
def create(cls, result): (source)

Undocumented

def __init__(self, dbapi_cursor, execution_options, growth_factor=5, initial_buffer=None): (source)

Undocumented

def fetchall(self, result, dbapi_cursor): (source)
def fetchmany(self, result, dbapi_cursor, size=None): (source)
def fetchone(self, result, dbapi_cursor, hard_close=False): (source)
def hard_close(self, result, dbapi_cursor): (source)
def soft_close(self, result, dbapi_cursor): (source)
def yield_per(self, result, dbapi_cursor, num): (source)
def _buffer_rows(self, result, dbapi_cursor): (source)

this is currently used only by fetchone().

_bufsize = (source)

Undocumented

_growth_factor: int = (source)

Undocumented

_max_row_buffer = (source)

Undocumented

_rowbuffer = (source)

Undocumented