MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / connect

Method connect

lib/sqlalchemy/pool/impl.py:444–455  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

442 return c
443
444 def connect(self) -> PoolProxiedConnection:
445 # vendored from Pool to include the now removed use_threadlocal
446 # behavior
447 try:
448 rec = cast(_ConnectionFairy, self._fairy.current())
449 except AttributeError:
450 pass
451 else:
452 if rec is not None:
453 return rec._checkout_existing()
454
455 return _ConnectionFairy._checkout(self, self._fairy)
456
457
458class StaticPool(Pool):

Calls 3

castFunction · 0.85
_checkout_existingMethod · 0.80
_checkoutMethod · 0.80