MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / fetchmany

Method fetchmany

pymysql/cursors.py:295–305  ·  view source on GitHub ↗

Fetch several rows.

(self, size=None)

Source from the content-addressed store, hash-verified

293 return result
294
295 def fetchmany(self, size=None):
296 """Fetch several rows."""
297 self._check_executed()
298 if self._rows is None:
299 # Django expects () for EOF.
300 # https://github.com/django/django/blob/0c1518ee429b01c145cf5b34eab01b0b92f8c246/django/db/backends/mysql/features.py#L8
301 return ()
302 end = self.rownumber + (size or self.arraysize)
303 result = self._rows[self.rownumber : end]
304 self.rownumber = min(end, len(self._rows))
305 return result
306
307 def fetchall(self):
308 """Fetch all the rows."""

Callers 4

test_SSCursorMethod · 0.45
test_warningsMethod · 0.45
test_DictCursorMethod · 0.45
test_custom_dictMethod · 0.45

Calls 1

_check_executedMethod · 0.95

Tested by 4

test_SSCursorMethod · 0.36
test_warningsMethod · 0.36
test_DictCursorMethod · 0.36
test_custom_dictMethod · 0.36