class ConnectionCharacteristic(abc.ABC): (source)
Known subclasses: sqlalchemy.dialects.postgresql.base.PGDeferrableConnectionCharacteristic
, sqlalchemy.dialects.postgresql.base.PGReadOnlyConnectionCharacteristic
, sqlalchemy.engine.characteristics.IsolationLevelCharacteristic
An abstract base for an object that can set, get and reset a per-connection characteristic, typically one that gets reset when the connection is returned to the connection pool. transaction isolation is the canonical example, and the ``IsolationLevelCharacteristic`` implementation provides this for the ``DefaultDialect``. The ``ConnectionCharacteristic`` class should call upon the ``Dialect`` for the implementation of each method. The object exists strictly to serve as a dialect visitor that can be placed into the ``DefaultDialect.connection_characteristics`` dictionary where it will take effect for calls to :meth:`_engine.Connection.execution_options` and related APIs. .. versionadded:: 1.4
Method | get |
Given a DBAPI connection, get the current value of the characteristic. |
Method | reset |
Reset the characteristic on the connection to its default value. |
Method | set |
set characteristic on the connection to a given value. |
Class Variable | __slots__ |
Undocumented |
Class Variable | transactional |
Undocumented |
def get_characteristic(self, dialect:
Dialect
, dbapi_conn: DBAPIConnection
) -> Any
:
(source)
¶
sqlalchemy.dialects.postgresql.base.PGDeferrableConnectionCharacteristic
, sqlalchemy.dialects.postgresql.base.PGReadOnlyConnectionCharacteristic
, sqlalchemy.engine.characteristics.IsolationLevelCharacteristic
Given a DBAPI connection, get the current value of the characteristic.
def reset_characteristic(self, dialect:
Dialect
, dbapi_conn: DBAPIConnection
):
(source)
¶
sqlalchemy.dialects.postgresql.base.PGDeferrableConnectionCharacteristic
, sqlalchemy.dialects.postgresql.base.PGReadOnlyConnectionCharacteristic
, sqlalchemy.engine.characteristics.IsolationLevelCharacteristic
Reset the characteristic on the connection to its default value.
def set_characteristic(self, dialect:
Dialect
, dbapi_conn: DBAPIConnection
, value: Any
):
(source)
¶
sqlalchemy.dialects.postgresql.base.PGDeferrableConnectionCharacteristic
, sqlalchemy.dialects.postgresql.base.PGReadOnlyConnectionCharacteristic
, sqlalchemy.engine.characteristics.IsolationLevelCharacteristic
set characteristic on the connection to a given value.