MCPcopy Index your code
hub / github.com/davispuh/MySQL-for-Python-3 / scroll

Method scroll

MySQLdb/cursors.py:391–408  ·  view source on GitHub ↗

Scroll 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.

(self, value, mode='relative')

Source from the content-addressed store, hash-verified

389 return result
390
391 def scroll(self, value, mode='relative'):
392 """Scroll the cursor in the result set to a new position according
393 to mode.
394
395 If mode is 'relative' (default), value is taken as offset to
396 the current position in the result set, if set to 'absolute',
397 value states an absolute target position."""
398 self._check_executed()
399 if mode == 'relative':
400 r = self.rownumber + value
401 elif mode == 'absolute':
402 r = value
403 else:
404 self.errorhandler(self, ProgrammingError,
405 "unknown scroll mode %s" % repr(mode))
406 if r < 0 or r >= len(self._rows):
407 self.errorhandler(self, IndexError, "out of range")
408 self.rownumber = r
409
410 def __iter__(self):
411 self._check_executed()

Callers

nothing calls this directly

Calls 1

_check_executedMethod · 0.80

Tested by

no test coverage detected