Fetch several rows.
(self, size=None)
| 288 | return result |
| 289 | |
| 290 | def fetchmany(self, size=None): |
| 291 | """Fetch several rows.""" |
| 292 | self._check_executed() |
| 293 | if self._rows is None: |
| 294 | # Django expects () for EOF. |
| 295 | # https://github.com/django/django/blob/0c1518ee429b01c145cf5b34eab01b0b92f8c246/django/db/backends/mysql/features.py#L8 |
| 296 | return () |
| 297 | end = self.rownumber + (size or self.arraysize) |
| 298 | result = self._rows[self.rownumber : end] |
| 299 | self.rownumber = min(end, len(self._rows)) |
| 300 | return result |
| 301 | |
| 302 | def fetchall(self): |
| 303 | """Fetch all the rows.""" |