a
    •˜ëj   ã                   @  s”   d dl mZ d dlZd dlZd dlmZ d dlmZ ejr^ddlmZ ddl	m
Z
 ddl	mZ G d	d
„ d
ejƒZG dd„ deƒZG dd„ deƒZdS )é    )ÚannotationsN)ÚAny)ÚClassVaré   )Ú
Connection)ÚDBAPIConnection)ÚDialectc                   @  s–   e Zd ZU dZdZdZded< ejdddd	œd
d„ƒZ	ejdddddœdd„ƒZ
ddddddœdd„Zejdddd	œdd„ƒZdddddœdd„ZdS )ÚConnectionCharacteristica÷  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

    © FúClassVar[bool]Útransactionalr   r   ÚNone©ÚdialectÚ
dbapi_connÚreturnc                 C  s   dS )zNReset the characteristic on the DBAPI connection to its default
        value.Nr
   ©Úselfr   r   r
   r
   ú`/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/sqlalchemy/engine/characteristics.pyÚreset_characteristic,   s    z-ConnectionCharacteristic.reset_characteristicr   ©r   r   Úvaluer   c                 C  s   dS )z<set characteristic on the DBAPI connection to a given value.Nr
   ©r   r   r   r   r
   r
   r   Úset_characteristic3   s    z+ConnectionCharacteristic.set_characteristicr   ©r   Úconnr   r   r   c                 C  s   |   |||¡ dS )zÜset characteristic on the :class:`_engine.Connection` to a given
        value.

        .. versionadded:: 2.0.30 - added to support elements that are local
           to the :class:`_engine.Connection` itself.

        N)r   ©r   r   r   r   r   r
   r
   r   Úset_connection_characteristic9   s    z6ConnectionCharacteristic.set_connection_characteristicc                 C  s   dS )zXGiven a DBAPI connection, get the current value of the
        characteristic.

        Nr
   r   r
   r
   r   Úget_characteristicI   s    z+ConnectionCharacteristic.get_characteristic©r   r   r   r   c                 C  s   |   ||¡S )zæGiven a :class:`_engine.Connection`, get the current value of the
        characteristic.

        .. versionadded:: 2.0.30 - added to support elements that are local
           to the :class:`_engine.Connection` itself.

        )r   ©r   r   r   r   r
   r
   r   Úget_connection_characteristicR   s    
z6ConnectionCharacteristic.get_connection_characteristicN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   Ú__annotations__ÚabcÚabstractmethodr   r   r   r   r!   r
   r
   r
   r   r	      s   
r	   c                   @  sV   e Zd ZU dZdZded< ddddœd	d
„Zdddddœdd„Zddddœdd„ZdS )ÚIsolationLevelCharacteristicz0Manage the isolation level on a DBAPI connectionTr   r   r   r   r   r   c                 C  s   |  |¡ d S ©N)Zreset_isolation_levelr   r
   r
   r   r   d   s    z1IsolationLevelCharacteristic.reset_characteristicr   r   c                 C  s   |  ||¡ d S r+   )Z_assert_and_set_isolation_levelr   r
   r
   r   r   i   s    z/IsolationLevelCharacteristic.set_characteristicc                 C  s
   |  |¡S r+   )Zget_isolation_levelr   r
   r
   r   r   n   s    z/IsolationLevelCharacteristic.get_characteristicN)	r"   r#   r$   r%   r   r'   r   r   r   r
   r
   r
   r   r*   _   s
   
r*   c                   @  s€   e Zd ZU dZdZded< ddddœd	d
„Zdddddœdd„Zddddddœdd„Zddddœdd„Z	dddddœdd„Z
dS )ÚLoggingTokenCharacteristiczgManage the 'logging_token' option of a :class:`_engine.Connection`.

    .. versionadded:: 2.0.30

    Fr   r   r   r   r   r   c                 C  s   d S r+   r
   r   r
   r
   r   r   }   s    z/LoggingTokenCharacteristic.reset_characteristicr   r   c                 C  s
   t ƒ ‚d S r+   ©ÚNotImplementedErrorr   r
   r
   r   r   ‚   s    z-LoggingTokenCharacteristic.set_characteristicr   r   c                   s   ˆ r‡ fdd„|_ nd |_ d S )Nc                   s   dˆ | f S )Nz[%s] %sr
   )Úmsg©r   r
   r   Ú<lambda>�   ó    zJLoggingTokenCharacteristic.set_connection_characteristic.<locals>.<lambda>)Z_message_formatterr   r
   r0   r   r   ‡   s    z8LoggingTokenCharacteristic.set_connection_characteristicc                 C  s
   t ƒ ‚d S r+   r-   r   r
   r
   r   r   “   s    z-LoggingTokenCharacteristic.get_characteristicr   c                 C  s   |j  dd ¡S )NZlogging_token)Z_execution_optionsÚgetr    r
   r
   r   r!   ˜   s    z8LoggingTokenCharacteristic.get_connection_characteristicN)r"   r#   r$   r%   r   r'   r   r   r   r   r!   r
   r
   r
   r   r,   t   s   
r,   )Ú
__future__r   r(   Útypingr   r   ÚTYPE_CHECKINGÚbaser   Z
interfacesr   r   ÚABCr	   r*   r,   r
   r
   r
   r   Ú<module>   s   K