U
    d(	                     @  sx   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rRddlmZ ddlm	Z	 G dd	 d	ej
ZG d
d deZdS )    )annotationsN)Any)ClassVar   )DBAPIConnection)Dialectc                   @  sl   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
ej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 )z@Reset the characteristic on the connection to its default value.Nr	   selfr   r   r	   r	   E/tmp/pip-unpacked-wheel-wbr0uges/sqlalchemy/engine/characteristics.pyreset_characteristic%   s    z-ConnectionCharacteristic.reset_characteristicr   r   r   valuer   c                 C  s   dS )z6set characteristic on the connection to a given value.Nr	   r   r   r   r   r	   r	   r   set_characteristic+   s    z+ConnectionCharacteristic.set_characteristicc                 C  s   dS )zXGiven a DBAPI connection, get the current value of the
        characteristic.

        Nr	   r   r	   r	   r   get_characteristic1   s    z+ConnectionCharacteristic.get_characteristicN)__name__
__module____qualname____doc__	__slots__r   __annotations__abcabstractmethodr   r   r   r	   r	   r	   r   r      s   
r   c                   @  sR   e Zd ZU 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 )IsolationLevelCharacteristicTr
   r   r   r   r   r   c                 C  s   | | d S N)Zreset_isolation_levelr   r	   r	   r   r   >   s    z1IsolationLevelCharacteristic.reset_characteristicr   r   c                 C  s   | || d S r#   )Z_assert_and_set_isolation_levelr   r	   r	   r   r   C   s    z/IsolationLevelCharacteristic.set_characteristicc                 C  s
   | |S r#   )Zget_isolation_levelr   r	   r	   r   r   H   s    z/IsolationLevelCharacteristic.get_characteristicN)r   r   r   r   r   r   r   r   r	   r	   r	   r   r"   ;   s   
r"   )
__future__r   r    typingr   r   TYPE_CHECKINGZ
interfacesr   r   ABCr   r"   r	   r	   r	   r   <module>   s   .