MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / fetchmany

Method fetchmany

lib/sqlalchemy/engine/result.py:947–968  ·  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

945 return row
946
947 def fetchmany(
948 self, size: Optional[int] = None
949 ) -> Sequence[Row[Unpack[_Ts]]]:
950 """Fetch many rows.
951
952 When all rows are exhausted, returns an empty sequence.
953
954 This method is provided for backwards compatibility with
955 SQLAlchemy 1.x.x.
956
957 To fetch rows in groups, use the :meth:`_engine.Result.partitions`
958 method.
959
960 :return: a sequence of :class:`_engine.Row` objects.
961
962 .. seealso::
963
964 :meth:`_engine.Result.partitions`
965
966 """
967
968 return self._manyrow_getter(self, size)
969
970 def all(self) -> Sequence[Row[Unpack[_Ts]]]:
971 """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