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

Method fetchmany

pymysql/cursors.py:294–304  ·  view source on GitHub ↗

Fetch several rows.

(self, size=None)

Source from the content-addressed store, hash-verified

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