MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / fetchmany

Method fetchmany

pager_lib/pymysql/cursors.py:484–502  ·  view source on GitHub ↗

Fetch many.

(self, size=None)

Source from the content-addressed store, hash-verified

482 return iter(self.fetchone, None)
483
484 def fetchmany(self, size=None):
485 """Fetch many."""
486 self._check_executed()
487 if size is None:
488 size = self.arraysize
489
490 rows = []
491 for i in range(size):
492 row = self.read_next()
493 if row is None:
494 self.warning_count = self._result.warning_count
495 break
496 rows.append(row)
497 self.rownumber += 1
498 if not rows:
499 # Django expects () for EOF.
500 # https://github.com/django/django/blob/0c1518ee429b01c145cf5b34eab01b0b92f8c246/django/db/backends/mysql/features.py#L8
501 return ()
502 return rows
503
504 def scroll(self, value, mode="relative"):
505 self._check_executed()

Callers

nothing calls this directly

Calls 4

read_nextMethod · 0.95
rangeFunction · 0.85
_check_executedMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected