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

Method close

lib/sqlalchemy/connectors/asyncio.py:234–248  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

232 await self._cursor.close()
233
234 def close(self) -> None:
235 self._rows.clear()
236
237 # updated as of 2.0.44
238 # try to "close" the cursor based on what we know about the driver
239 # and if we are able to. otherwise, hope that the asyncio
240 # extension called _async_soft_close() if the cursor is going into
241 # a sync context
242 if self._cursor is None or bool(self._soft_closed_memoized):
243 return
244
245 if not self._awaitable_cursor_close:
246 self._cursor.close() # type: ignore[unused-coroutine]
247 elif in_greenlet():
248 await_(self._cursor.close())
249
250 def execute(
251 self,

Callers 1

__exit__Method · 0.95

Calls 4

in_greenletFunction · 0.85
await_Function · 0.85
clearMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected