
    g                        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y)    )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y)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]transactionalc                     y)zNReset the characteristic on the DBAPI connection to its default
        value.Nr   selfdialect
dbapi_conns      `/var/www/html/AdoubleTech/venv/lib/python3.12/site-packages/sqlalchemy/engine/characteristics.pyreset_characteristicz-ConnectionCharacteristic.reset_characteristic,           c                     y)z<set characteristic on the DBAPI connection to a given value.Nr   r   r   r   values       r   set_characteristicz+ConnectionCharacteristic.set_characteristic3   r   r   c                *    | j                  |||       y)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   connr   r   s        r   set_connection_characteristicz6ConnectionCharacteristic.set_connection_characteristic9   s     	U;r   c                     y)zXGiven a DBAPI connection, get the current value of the
        characteristic.

        Nr   r   s      r   get_characteristicz+ConnectionCharacteristic.get_characteristicI   r   r   c                &    | j                  ||      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   returnNone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DGK	K K
<< < $	<
 < 
<  	,;	 
<
<&0
<>M
<	
<r   r   c                  `    e Zd ZU dZdZded<   	 	 	 	 	 	 d	dZ	 	 	 	 	 	 	 	 d
dZ	 	 	 	 	 	 ddZy)IsolationLevelCharacteristicz0Manage the isolation level on a DBAPI connectionTr   r   c                &    |j                  |       y N)reset_isolation_levelr   s      r   r   z1IsolationLevelCharacteristic.reset_characteristicd   s     	%%j1r   c                (    |j                  ||       y r7   )_assert_and_set_isolation_levelr   s       r   r   z/IsolationLevelCharacteristic.set_characteristici   s     	//
EBr   c                $    |j                  |      S r7   )get_isolation_levelr   s      r   r!   z/IsolationLevelCharacteristic.get_characteristicn   s     **:66r   Nr%   r(   r*   )	r,   r-   r.   r/   r   r1   r   r   r!   r   r   r   r5   r5   _   ss    :$(M>(22,;2	2
CC,;CDGC	C
77,;7	7r   r5   c                      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
y
)LoggingTokenCharacteristiczgManage the 'logging_token' option of a :class:`_engine.Connection`.

    .. versionadded:: 2.0.30

    Fr   r   c                     y r7   r   r   s      r   r   z/LoggingTokenCharacteristic.reset_characteristic}   s     	r   c                    t               r7   NotImplementedErrorr   s       r   r   z-LoggingTokenCharacteristic.set_characteristic        "##r   c                $    rfd|_         y |` y )Nc                    dd| S )N[z] r   )msgr   s    r   <lambda>zJLoggingTokenCharacteristic.set_connection_characteristic.<locals>.<lambda>   s    uc2J r   )_message_formatterr   s       `r   r   z8LoggingTokenCharacteristic.set_connection_characteristic   s     &JD#'r   c                    t               r7   rA   r   s      r   r!   z-LoggingTokenCharacteristic.get_characteristic   rC   r   c                :    |j                   j                  dd       S )Nlogging_token)_execution_optionsgetr#   s       r   r$   z8LoggingTokenCharacteristic.get_connection_characteristic   s     &&**?D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>),;	
$$,;$DG$	$

(
( 
( $	
(
 
( 

($$,;$	$
BB&0B>MB	Br   r>   )
__future__r   r2   typingr   r   TYPE_CHECKINGbaser   
interfacesr   r	   ABCr   r5   r>   r   r   r   <module>rU      sW    # 
   	 +#H<sww H<V7#; 7*'B!9 'Br   