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

Method fetchmany

pymysql/cursors.py:468–486  ·  view source on GitHub ↗

Fetch many.

(self, size=None)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

read_nextMethod · 0.95
_check_executedMethod · 0.80

Tested by

no test coverage detected