
    [h                        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
ej                  Z G d de          Z G d de          ZdS )    )annotationsN)Any)ClassVar   )
Connection)DBAPIConnection)Dialectc                      e Zd ZU dZdZdZded<   ej        dd            Z	ej        dd            Z
ddZej        dd            Z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]transactionaldialectr	   
dbapi_connr   returnNonec                    dS )zNReset the characteristic on the DBAPI connection to its default
        value.Nr   selfr   r   s      p/var/www/api.easyaligner.net/htdocs/venv_linux/lib/python3.11/site-packages/sqlalchemy/engine/characteristics.pyreset_characteristicz-ConnectionCharacteristic.reset_characteristic,             valuer   c                    dS )z<set characteristic on the DBAPI connection to a given value.Nr   r   r   r   r   s       r   set_characteristicz+ConnectionCharacteristic.set_characteristic3   r   r   connr   c                4    |                      |||           dS )zset 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   s        r   set_connection_characteristicz6ConnectionCharacteristic.set_connection_characteristic9   s"     	U;;;;;r   c                    dS )zXGiven a DBAPI connection, get the current value of the
        characteristic.

        Nr   r   s      r   get_characteristicz+ConnectionCharacteristic.get_characteristicI   r   r   c                .    |                      ||          S )zGiven 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   s       r   get_connection_characteristicz6ConnectionCharacteristic.get_connection_characteristicR   s     &&w
;;;r   Nr   r	   r   r   r   r   r   r	   r   r   r   r   r   r   
r   r	   r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r	   r   r   r   r   r   r   )__name__
__module____qualname____doc__	__slots__r   __annotations__abcabstractmethodr   r   r!   r#   r&   r   r   r   r   r      s          & I$)M))))    	K K K K
< < < <  	   
< 
< 
< 
< 
< 
<r   r   c                  :    e Zd ZU dZdZded<   ddZddZddZdS )IsolationLevelCharacteristicz0Manage the isolation level on a DBAPI connectionTr   r   r   r	   r   r   r   r   c                0    |                     |           d S N)reset_isolation_levelr   s      r   r   z1IsolationLevelCharacteristic.reset_characteristicd   s     	%%j11111r   r   r   c                2    |                     ||           d S r7   )_assert_and_set_isolation_levelr   s       r   r   z/IsolationLevelCharacteristic.set_characteristici   s      	//
EBBBBBr   c                ,    |                     |          S r7   )get_isolation_levelr   s      r   r#   z/IsolationLevelCharacteristic.get_characteristicn   s     **:666r   Nr'   r(   r*   )	r,   r-   r.   r/   r   r1   r   r   r#   r   r   r   r5   r5   _   sm         ::$(M((((2 2 2 2
C C C C
7 7 7 7 7 7r   r5   c                  J    e Zd ZU dZdZded<   ddZddZddZddZ	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   r   r   c                    d S r7   r   r   s      r   r   z/LoggingTokenCharacteristic.reset_characteristic}   s	     	r   r   r   c                    t                      r7   NotImplementedErrorr   s       r   r   z-LoggingTokenCharacteristic.set_characteristic        "###r   r   r   c                (    rfd|_         d S |` d S )Nc                    dd| S )N[z] r   )msgr   s    r   <lambda>zJLoggingTokenCharacteristic.set_connection_characteristic.<locals>.<lambda>   s     uuucc2J r   )_message_formatterr    s       `r   r!   z8LoggingTokenCharacteristic.set_connection_characteristic   s0      	(&J&J&J&JD###'''r   c                    t                      r7   rA   r   s      r   r#   z-LoggingTokenCharacteristic.get_characteristic   rC   r   c                8    |j                             dd           S )Nlogging_token)_execution_optionsgetr%   s       r   r&   z8LoggingTokenCharacteristic.get_connection_characteristic   s     &**?DAAAr   Nr'   r(   r)   r*   r+   )r,   r-   r.   r/   r   r1   r   r   r!   r#   r&   r   r   r   r>   r>   t   s           %*M))))   
$ $ $ $

( 
( 
( 
($ $ $ $
B B B B B Br   r>   )
__future__r   r2   typingr   r   TYPE_CHECKINGbaser   
interfacesr   r	   ABCr   r5   r>   r   r   r   <module>rU      s/   # " " " " " 



             	 $      ++++++######H< H< H< H< H<sw H< H< H<V7 7 7 7 7#; 7 7 7*'B 'B 'B 'B 'B!9 'B 'B 'B 'B 'Br   