class BufferedRowCursorFetchStrategy(CursorFetchStrategy): (source)
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 |
Undocumented |
Method | soft |
Undocumented |
Method | yield |
Undocumented |
Class Variable | __slots__ |
Undocumented |
Method | _buffer |
this is currently used only by fetchone(). |
Instance Variable | _bufsize |
Undocumented |
Instance Variable | _growth |
Undocumented |
Instance Variable | _max |
Undocumented |
Instance Variable | _rowbuffer |
Undocumented |
Inherited from CursorFetchStrategy
:
Method | handle |
Undocumented |
Inherited from ResultFetchStrategy
(via CursorFetchStrategy
):
Class Variable | alternate |
Undocumented |