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

Method fetchmany

lib/sqlalchemy/engine/result.py:1395–1414  ·  view source on GitHub ↗

Fetch many rows. When all rows are exhausted, returns an empty sequence. This method is provided for backwards compatibility with SQLAlchemy 1.x.x. To fetch rows in groups, use the :meth:`_engine.Result.partitions` method. :return: a sequence of :c

(self, size: Optional[int] = None)

Source from the content-addressed store, hash-verified

1393 return row
1394
1395 def fetchmany(self, size: Optional[int] = None) -> Sequence[Row[_TP]]:
1396 """Fetch many rows.
1397
1398 When all rows are exhausted, returns an empty sequence.
1399
1400 This method is provided for backwards compatibility with
1401 SQLAlchemy 1.x.x.
1402
1403 To fetch rows in groups, use the :meth:`_engine.Result.partitions`
1404 method.
1405
1406 :return: a sequence of :class:`_engine.Row` objects.
1407
1408 .. seealso::
1409
1410 :meth:`_engine.Result.partitions`
1411
1412 """
1413
1414 return self._manyrow_getter(self, size)
1415
1416 def all(self) -> Sequence[Row[_TP]]:
1417 """Return all rows in a sequence.

Callers 4

chunksFunction · 0.45
test_core_fetchmanyFunction · 0.45

Calls 1

_manyrow_getterMethod · 0.80

Tested by 3

test_core_fetchmanyFunction · 0.36