class documentation

class AdaptedConnection: (source)

View In Hierarchy

Interface of an adapted connection object to support the DBAPI protocol. Used by asyncio dialects to provide a sync-style pep-249 facade on top of the asyncio connection/cursor API provided by the driver. .. versionadded:: 1.4.24

Method __repr__ Undocumented
Method run_async Run the awaitable returned by the given function, which is passed the raw asyncio driver connection.
Class Variable __slots__ Undocumented
Property driver_connection The connection object as returned by the driver after a connect.
Class Variable _connection Undocumented
def __repr__(self) -> str: (source)

Undocumented

def run_async(self, fn: Callable[[Any], Awaitable[_T]]) -> _T: (source)

Run the awaitable returned by the given function, which is passed the raw asyncio driver connection. This is used to invoke awaitable-only methods on the driver connection within the context of a "synchronous" method, like a connection pool event handler. E.g.:: engine = create_async_engine(...) @event.listens_for(engine.sync_engine, "connect") def register_custom_types(dbapi_connection, ...): dbapi_connection.run_async( lambda connection: connection.set_type_codec( 'MyCustomType', encoder, decoder, ... ) ) .. versionadded:: 1.4.30 .. seealso:: :ref:`asyncio_events_run_async`

__slots__: tuple[str, ...] = (source)

Undocumented

@property
driver_connection: Any = (source)

The connection object as returned by the driver after a connect.

_connection: Any = (source)

Undocumented