class BufferedRowCursorFetchStrategy(CursorFetchStrategy):
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"))
See Also
Class Method | create |
Undocumented |
Method | __init__ |
Undocumented |
Method | _buffer_rows |
this is currently used only by fetchone(). |
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 |
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 |
Undocumented