MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / detach

Method detach

lib/sqlalchemy/pool/base.py:1497–1512  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1495 return getattr(self.dbapi_connection, key)
1496
1497 def detach(self) -> None:
1498 if self._connection_record is not None:
1499 rec = self._connection_record
1500 rec.fairy_ref = None
1501 rec.dbapi_connection = None
1502 # TODO: should this be _return_conn?
1503 self._pool._do_return_conn(self._connection_record)
1504
1505 # can't get the descriptor assignment to work here
1506 # in pylance. mypy is OK w/ it
1507 self.info = self.info.copy() # type: ignore
1508
1509 self._connection_record = None
1510
1511 if self._pool.dispatch.detach:
1512 self._pool.dispatch.detach(self.dbapi_connection, rec)
1513
1514 def close(self) -> None:
1515 self._counter -= 1

Callers 1

_finalize_fairyFunction · 0.45

Calls 2

_do_return_connMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected