MCPcopy
hub / github.com/psycopg/psycopg / scroll

Method scroll

psycopg/psycopg/cursor.py:298–310  ·  view source on GitHub ↗

Move the cursor in the result set to a new position according to mode. If `!mode` is ``'relative'`` (default), `!value` is taken as offset to the current position in the result set; if set to ``'absolute'``, `!value` states an absolute target position. Rais

(self, value: int, mode: str = "relative")

Source from the content-addressed store, hash-verified

296 raise StopIteration("no more records to return")
297
298 def scroll(self, value: int, mode: str = "relative") -> None:
299 """
300 Move the cursor in the result set to a new position according to mode.
301
302 If `!mode` is ``'relative'`` (default), `!value` is taken as offset to
303 the current position in the result set; if set to ``'absolute'``,
304 `!value` states an absolute target position.
305
306 Raise `!IndexError` in case a scroll operation would leave the result
307 set. In this case the position will not change.
308 """
309 self._fetch_pipeline()
310 self._scroll(value, mode)
311
312 @contextmanager
313 def copy(

Callers 15

test_row_factoryFunction · 0.45
test_scrollFunction · 0.45
test_scrollableFunction · 0.45
test_non_scrollableFunction · 0.45
test_row_factoryFunction · 0.45
test_scrollFunction · 0.45
test_scrollableFunction · 0.45
test_non_scrollableFunction · 0.45
test_row_factoryFunction · 0.45
test_scrollFunction · 0.45

Calls 2

_fetch_pipelineMethod · 0.95
_scrollMethod · 0.80

Tested by 15

test_row_factoryFunction · 0.36
test_scrollFunction · 0.36
test_scrollableFunction · 0.36
test_non_scrollableFunction · 0.36
test_row_factoryFunction · 0.36
test_scrollFunction · 0.36
test_scrollableFunction · 0.36
test_non_scrollableFunction · 0.36
test_row_factoryFunction · 0.36
test_scrollFunction · 0.36