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

Method fetchmany

pymysql/cursors.py:472–490  ·  view source on GitHub ↗

Fetch many.

(self, size=None)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

read_nextMethod · 0.95
_check_executedMethod · 0.80

Tested by

no test coverage detected