MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / scroll

Method scroll

pymysql/cursors.py:488–511  ·  view source on GitHub ↗
(self, value, mode="relative")

Source from the content-addressed store, hash-verified

486 return rows
487
488 def scroll(self, value, mode="relative"):
489 self._check_executed()
490
491 if mode == "relative":
492 if value < 0:
493 raise err.NotSupportedError(
494 "Backwards scrolling not supported by this cursor"
495 )
496
497 for _ in range(value):
498 self.read_next()
499 self.rownumber += value
500 elif mode == "absolute":
501 if value < self.rownumber:
502 raise err.NotSupportedError(
503 "Backwards scrolling not supported by this cursor"
504 )
505
506 end = value - self.rownumber
507 for _ in range(end):
508 self.read_next()
509 self.rownumber = value
510 else:
511 raise err.ProgrammingError("unknown scroll mode %s" % mode)
512
513
514class SSDictCursor(DictCursorMixin, SSCursor):

Callers

nothing calls this directly

Calls 2

read_nextMethod · 0.95
_check_executedMethod · 0.80

Tested by

no test coverage detected