MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / close

Method close

lib/sqlalchemy/engine/cursor.py:2396–2416  ·  view source on GitHub ↗

Close this :class:`_engine.CursorResult`. This closes out the underlying DBAPI cursor corresponding to the statement execution, if one is still present. Note that the DBAPI cursor is automatically released when the :class:`_engine.CursorResult` exhausts all availabl

(self)

Source from the content-addressed store, hash-verified

2394 return merged_result
2395
2396 def close(self) -> None:
2397 """Close this :class:`_engine.CursorResult`.
2398
2399 This closes out the underlying DBAPI cursor corresponding to the
2400 statement execution, if one is still present. Note that the DBAPI
2401 cursor is automatically released when the :class:`_engine.CursorResult`
2402 exhausts all available rows. :meth:`_engine.CursorResult.close` is
2403 generally an optional method except in the case when discarding a
2404 :class:`_engine.CursorResult` that still has additional rows pending
2405 for fetch.
2406
2407 After this method is called, it is no longer valid to call upon
2408 the fetch methods, which will raise a :class:`.ResourceClosedError`
2409 on subsequent use.
2410
2411 .. seealso::
2412
2413 :ref:`connections_toplevel`
2414
2415 """
2416 self._soft_close(hard=True)
2417
2418 @_generative
2419 def yield_per(self, num: int) -> Self:

Callers

nothing calls this directly

Calls 1

_soft_closeMethod · 0.95

Tested by

no test coverage detected