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

Method fetchmany

lib/sqlalchemy/engine/cursor.py:1291–1307  ·  view source on GitHub ↗
(
        self,
        result: CursorResult[Any],
        dbapi_cursor: DBAPICursor,
        size: Optional[int] = None,
    )

Source from the content-addressed store, hash-verified

1289 self.handle_exception(result, dbapi_cursor, e)
1290
1291 def fetchmany(
1292 self,
1293 result: CursorResult[Any],
1294 dbapi_cursor: DBAPICursor,
1295 size: Optional[int] = None,
1296 ) -> Any:
1297 try:
1298 if size is None:
1299 l = dbapi_cursor.fetchmany()
1300 else:
1301 l = dbapi_cursor.fetchmany(size)
1302
1303 if not l:
1304 result._soft_close()
1305 return l
1306 except BaseException as e:
1307 self.handle_exception(result, dbapi_cursor, e)
1308
1309 def fetchall(
1310 self,

Callers

nothing calls this directly

Calls 3

handle_exceptionMethod · 0.95
fetchmanyMethod · 0.45
_soft_closeMethod · 0.45

Tested by

no test coverage detected