Ë
    ðmxi2  ã                  ó"  — d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ ddlmZ dd	lm	Z	 dd
l
mZ ddlmZ ddlmZ ej                  sesddlmZ ddlmZ nd dlmZ d dlmZ  edeg ef   ¬«      Zdd„Z G d„ de«      Z G d„ d«      Zy)é    )ÚannotationsN)ÚAny)ÚCallable)ÚOptional)ÚTypeVaré   )Úexc)Úutil)ÚHAS_CYEXTENSION)ÚProtocol)ÚSelfé   )Ú_distill_params_20)Ú_distill_raw_paramsÚ_C)Úboundc                ó8   ‡ — t         j                  ˆ fd„«       }|S )zËDecorator, memoize a function in a connection.info stash.

    Only applicable to functions which take no arguments other than a
    connection.  The memo will be stored in ``connection.info[key]``.
    c                ó–   •— |j                  «       }	 |j                  ‰   S # t        $ r  | ||«      x|j                  ‰<   }|cY S w xY w©N)ÚconnectÚinfoÚKeyError)ÚfnÚselfÚ
connectionÚvalÚkeys       €úM/home/htdocs/ttos/venv/lib/python3.12/site-packages/sqlalchemy/engine/util.pyÚ	decoratedz%connection_memoize.<locals>.decorated+   sS   ø€ à×'Ñ'Ó)ˆ
ð	Ø—?‘? 3Ñ'Ð'øÜò 	Ù)+¨D°*Ó)=Ð=ˆJ�O‰O˜CÑ  3ØŠJð	ús   “" ¢#AÁA)r
   Ú	decorator)r   r   s   ` r   Úconnection_memoizer!   $   s#   ø€ ô 
‡^�^óó ðð Ðó    c                  ó   — e Zd ZU ded<   y)Ú_TConsSubjectzOptional[TransactionalContext]Ú_trans_context_managerN)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© r"   r   r$   r$   7   s   … Ø:Ô:r"   r$   c                  óz   — 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d
„Zdd„Zedd„«       Zdd„Zdd„Zy)ÚTransactionalContextzÀApply Python context manager behavior to transaction objects.

    Performs validation to ensure the subject of the transaction is not
    used if the transaction were ended prematurely.

    )Ú_outer_trans_ctxÚ_trans_subjectÚ__weakref__zOptional[_TConsSubject]r.   c                ó   — t        «       ‚r   ©ÚNotImplementedError©r   s    r   Ú_transaction_is_activez+TransactionalContext._transaction_is_activeG   ó   € Ü!Ó#Ð#r"   c                ó   — t        «       ‚r   r1   r3   s    r   Ú_transaction_is_closedz+TransactionalContext._transaction_is_closedJ   r5   r"   c                ó   — t        «       ‚)a  indicates the object is in a state that is known to be acceptable
        for rollback() to be called.

        This does not necessarily mean rollback() will succeed or not raise
        an error, just that there is currently no state detected that indicates
        rollback() would fail or emit warnings.

        It also does not mean that there's a transaction in progress, as
        it is usually safe to call rollback() even if no transaction is
        present.

        .. versionadded:: 1.4.28

        r1   r3   s    r   Ú_rollback_can_be_calledz,TransactionalContext._rollback_can_be_calledM   s   € ô "Ó#Ð#r"   c                ó   — t        «       ‚r   r1   r3   s    r   Ú_get_subjectz!TransactionalContext._get_subject^   r5   r"   c                ó   — t        «       ‚r   r1   r3   s    r   ÚcommitzTransactionalContext.commita   r5   r"   c                ó   — t        «       ‚r   r1   r3   s    r   ÚrollbackzTransactionalContext.rollbackd   r5   r"   c                ó   — t        «       ‚r   r1   r3   s    r   ÚclosezTransactionalContext.closeg   r5   r"   c                ól   — |j                   }|r&|j                  «       st        j                  d«      ‚y y )Nz‚Can't operate on closed transaction inside context manager.  Please complete the context manager before emitting further commands.)r%   r4   r	   ÚInvalidRequestError)ÚclsÚsubjectÚtrans_contexts      r   Ú_trans_ctx_checkz%TransactionalContext._trans_ctx_checkj   s>   € à×6Ñ6ˆÙØ ×7Ñ7Ô9Ü×-Ñ-ð8óð ð :ð r"   c                óh   — | j                  «       }|j                  }|| _        || _        | |_        | S r   )r;   r%   r-   r.   )r   rE   rF   s      r   Ú	__enter__zTransactionalContext.__enter__u   s:   € Ø×#Ñ#Ó%ˆð  ×6Ñ6ˆØ -ˆÔà%ˆÔØ)-ˆÔ&Øˆr"   c                ó  — t        | dd «      }|d u xs |j                  | u}|€G| j                  «       r7	 | j                  «        |s|€J ‚| j                  |_        d x| _	        | _        y 	 | j                  «       s!| j                  «       s1| j                  «        n | j                  «       r| j                  «        |s|€J ‚| j                  |_        d x| _	        | _        y #  t	        j
                  «       5  | j                  «       r| j                  «        d d d «       n# 1 sw Y   nxY wY ŒìxY w# |s|€J ‚| j                  |_        d x| _	        | _        w xY w# |s|€J ‚| j                  |_        d x| _	        | _        w xY w)Nr.   )Úgetattrr%   r4   r=   r
   Úsafe_reraiser9   r?   r-   r.   r7   rA   )r   Útype_ÚvalueÚ	tracebackrE   Úout_of_band_exits         r   Ú__exit__zTransactionalContext.__exit__�   s…  € Ü˜$Ð 0°$Ó7ˆð �tˆOÒI˜w×=Ñ=ÀTÐIð 	ð ˆ=˜T×8Ñ8Ô:ð
CØ—‘”ñ (Ø"Ð.Ð.Ð.Ø59×5JÑ5J�GÔ2Ø>BÐB�Ô# dÕ&;ðCØ×2Ñ2Ô4Ø×6Ñ6Ô8ØŸ
™
�à×3Ñ3Ô5ØŸ™œá'Ø"Ð.Ð.Ð.Ø59×5JÑ5J�GÔ2Ø>BÐB�Ô# dÕ&;øð+(Ü×&Ñ&Ó(ñ (Ø×3Ñ3Ô5ØŸ™œ÷(÷ (ñ (ÿøñ (Ø"Ð.Ð.Ð.Ø59×5JÑ5J�GÔ2Ø>BÐB�Ô# dÕ&;ûñ (Ø"Ð.Ð.Ð.Ø59×5JÑ5J�GÔ2Ø>BÐB�Ô# dÕ&;ús<   µC# Á,AE Ã#D1Ã9!D#Ä	D1Ä#D,	Ä(D1Ä/D4 Ä4'EÅ'FN)ÚreturnÚbool)rR   r$   )rR   ÚNone)rE   r$   rR   rT   )rR   r   )rM   r   rN   r   rO   r   rR   rT   )r&   r'   r(   Ú__doc__Ú	__slots__r)   r4   r7   r9   r;   r=   r?   rA   ÚclassmethodrG   rI   rQ   r*   r"   r   r,   r,   ;   sW   … ñð F€Ià+Ó+ó$ó$ó$ó"$ó$ó$ó$ð òó ðó
ô&Cr"   r,   )r   ÚstrrR   zCallable[[_C], _C])Ú
__future__r   Útypingr   r   r   r   Ú r	   r
   Úutil._has_cyr   Úutil.typingr   r   ÚTYPE_CHECKINGÚ_py_utilr   r   Úsqlalchemy.cyextension.utilr   r!   r$   r,   r*   r"   r   ú<module>ra      sy   ðõ #ã Ý Ý Ý Ý å Ý Ý *Ý "Ý à	×Ò™ÝBÞDõõñ ˆT˜ " c 'Ñ*Ô+€óô&;�Hô ;÷lCò lCr"   