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

Method fetchmany

pymysql/cursors.py:473–491  ·  view source on GitHub ↗

Fetch many.

(self, size=None)

Source from the content-addressed store, hash-verified

471 return iter(self.fetchone, None)
472
473 def fetchmany(self, size=None):
474 """Fetch many."""
475 self._check_executed()
476 if size is None:
477 size = self.arraysize
478
479 rows = []
480 for i in range(size):
481 row = self.read_next()
482 if row is None:
483 self.warning_count = self._result.warning_count
484 break
485 rows.append(row)
486 self.rownumber += 1
487 if not rows:
488 # Django expects () for EOF.
489 # https://github.com/django/django/blob/0c1518ee429b01c145cf5b34eab01b0b92f8c246/django/db/backends/mysql/features.py#L8
490 return ()
491 return rows
492
493 def scroll(self, value, mode="relative"):
494 self._check_executed()

Callers

nothing calls this directly

Calls 2

read_nextMethod · 0.95
_check_executedMethod · 0.80

Tested by

no test coverage detected