class documentation

class _AdhocProxiedConnection(PoolProxiedConnection): (source)

View In Hierarchy

provides the :class:`.PoolProxiedConnection` interface for cases where the DBAPI connection is not actually proxied. This is used by the engine internals to pass a consistent :class:`.PoolProxiedConnection` object to consuming dialects in response to pool events that may not always have the :class:`._ConnectionFairy` available.

Method __getattr__ Undocumented
Method __init__ Undocumented
Method cursor Undocumented
Method invalidate Mark the managed connection as invalidated.
Class Variable __slots__ Undocumented
Instance Variable dbapi_connection A reference to the actual DBAPI connection being tracked.
Property connection Undocumented
Property driver_connection The "driver level" connection object as used by the Python DBAPI or database driver.
Property is_valid Implement is_valid state attribute.
Property record_info Persistent info dictionary associated with this :class:`.ManagesConnection`.
Instance Variable _connection_record Undocumented
Instance Variable _is_valid Undocumented

Inherited from PoolProxiedConnection:

Method close Release this connection back to the pool.
Method commit Undocumented
Method detach Separate this connection from its Pool.
Method rollback Undocumented
Property is_detached Return True if this :class:`.PoolProxiedConnection` is detached from its pool.

Inherited from ManagesConnection (via PoolProxiedConnection):

Property info Info dictionary associated with the underlying DBAPI connection referred to by this :class:`.ManagesConnection` instance, allowing user-defined data to be associated with the connection.
def __getattr__(self, key: Any) -> Any: (source)

Undocumented

def __init__(self, dbapi_connection: DBAPIConnection, connection_record: ConnectionPoolEntry): (source)

Undocumented

def cursor(self, *args: Any, **kwargs: Any) -> DBAPICursor: (source)
def invalidate(self, e: Optional[BaseException] = None, soft: bool = False): (source)

Mark the managed connection as invalidated. :param e: an exception object indicating a reason for the invalidation. :param soft: if True, the connection isn't closed; instead, this connection will be recycled on next checkout. .. seealso:: :ref:`pool_connection_invalidation`

dbapi_connection = (source)

A reference to the actual DBAPI connection being tracked. This is a :pep:`249`-compliant object that for traditional sync-style dialects is provided by the third-party DBAPI implementation in use. For asyncio dialects, the implementation is typically an adapter object provided by the SQLAlchemy dialect itself; the underlying asyncio object is available via the :attr:`.ManagesConnection.driver_connection` attribute. SQLAlchemy's interface for the DBAPI connection is based on the :class:`.DBAPIConnection` protocol object .. seealso:: :attr:`.ManagesConnection.driver_connection` :ref:`faq_dbapi_connection`

Undocumented

@property
driver_connection: Any = (source)

The "driver level" connection object as used by the Python DBAPI or database driver. For traditional :pep:`249` DBAPI implementations, this object will be the same object as that of :attr:`.ManagesConnection.dbapi_connection`. For an asyncio database driver, this will be the ultimate "connection" object used by that driver, such as the ``asyncpg.Connection`` object which will not have standard pep-249 methods. .. versionadded:: 1.4.24 .. seealso:: :attr:`.ManagesConnection.dbapi_connection` :ref:`faq_dbapi_connection`

Implement is_valid state attribute. for the adhoc proxied connection it's assumed the connection is valid as there is no "invalidate" routine.

@util.ro_non_memoized_property
record_info: Optional[_InfoType] = (source)

Persistent info dictionary associated with this :class:`.ManagesConnection`. Unlike the :attr:`.ManagesConnection.info` dictionary, the lifespan of this dictionary is that of the :class:`.ConnectionPoolEntry` which owns it; therefore this dictionary will persist across reconnects and connection invalidation for a particular entry in the connection pool. For a :class:`.PoolProxiedConnection` instance that's not associated with a :class:`.ConnectionPoolEntry`, such as if it were detached, the attribute returns None. Contrast to the :attr:`.ManagesConnection.info` dictionary which is never None. .. seealso:: :attr:`.ManagesConnection.info`

_connection_record = (source)

Undocumented

_is_valid: bool = (source)

Undocumented