§
    YŠtjÒL  ã                  óv  — d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl	m
Z
mZmZmZ ddlmZ ddlmZmZ d	d
lmZ d	dlmZmZ d	dlmZmZmZmZmZmZmZ d	dlm Z  d	dl!m"Z" d	dl#m$Z$m%Z%m&Z&m'Z' d	dl(m)Z) d	dl*m+Z+ d	dl,m-Z- d	dl.m/Z/m0Z0 d	dl1m2Z2 d	dl3m4Z4m5Z5m6Z6 d	dl3m7Z7 d	dl8m9Z9 d	dl:m;Z; d	dl<m=Z= d	dl>m?Z? d	dl@mAZA d	dlBmCZC d	dlDmEZEmFZFmGZG e
rd	dlHmIZI dZJejK        jL        ZLejK        jM        ZMejN        jO        ZOejN        jP        ZPejN        jQ        ZQeRZS ejT        d ¦  «        ZU G d!„ d"eEe$         ¦  «        ZVdS )#z*
Psycopg connection object (sync version)
é    )ÚannotationsN)Ú	monotonic)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚcastÚoverload)Úcontextmanager)Ú	GeneratorÚIteratoré   )Úerrors)ÚpqÚwaiting)ÚRVÚAdaptContextÚConnDictÚ	ConnParamÚParamsÚPQGenÚQuery)ÚQueryNoTemplate)ÚXid)ÚRowÚ
RowFactoryÚargs_rowÚ	tuple_row)ÚAdaptersMap)ÚIsolationLevel)ÚCursor)ÚSelfÚTemplate)ÚLock)Úconninfo_attemptsÚconninfo_to_dictÚmake_conninfo)Útimeout_from_conninfo)ÚPipeline)Únotifies)ÚTransaction)Úcapabilities)ÚServerCursor)Úgssapi_requested)ÚBaseConnectionÚ	CursorRowÚNotify)ÚPGconngš™™™™™¹?Úpsycopgc                  óÀ  ‡ — e Zd ZU dZdZded<   ded<   ded<   d	ed
<    eee         e¦  «        fd|ˆ fd„Z	e
	 d}ddddddœd~d!„¦   «         Zdd"„Zd€d*„Ze
d�d-„¦   «         Zd‚d.„Zedd/œdƒd2„¦   «         Zedd/œd„d5„¦   «         Zedddd6œd…d<„¦   «         Zedddd6œd†d>„¦   «         Z	 d}ddddd?œd‡dB„Ze	 dˆdddCœd‰dI„¦   «         ZedddCœdŠdK„¦   «         Z	 dˆdddCœd‹dM„Zd‚dN„Zd‚dO„ZdPdQœdŒdT„ZdUdQœdŒdV„Ze	 d�dŽd[„¦   «         Zddd\œd�d`„Zed�db„¦   «         Zed�dc„¦   «         Zefd‘dh„Zd’dj„Zd’dk„Zd“dm„Z d“dn„Z!d”do„Z"d”dp„Z#d”dq„Z$d”dr„Z%d•du„Z&d‚dv„Z'dˆd–dx„Z(dˆd–dy„Z)d—d{„Z*ˆ xZ+S )˜Ú
Connectionz3
    Wrapper for a connection to the database.
    r2   ztype[Cursor[Row]]Úcursor_factoryztype[ServerCursor[Row]]Úserver_cursor_factoryúRowFactory[Row]Úrow_factoryzPipeline | NoneÚ	_pipelineÚpgconnr1   c                ó®   •— t          ¦   «                              |¦  «         || _        t          ¦   «         | _        t
          | _        t          | _        d S ©N)	ÚsuperÚ__init__r8   r#   Úlockr    r5   r,   r6   )Úselfr:   r8   Ú	__class__s      €úP/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/psycopg/connection.pyr>   zConnection.__init__F   sF   ø€ õ
 	‰Œ×Ò˜Ñ Ô Ð Ø&ˆÔÝ‘F”FˆŒ	Ý$ˆÔÝ%1ˆÔ"Ð"Ð"ó    Ú Fé   N)Ú
autocommitÚprepare_thresholdÚcontextr8   r5   ÚconninfoÚstrrF   ÚboolrG   ú
int | NonerH   úAdaptContext | NoneúRowFactory[Row] | Noneútype[Cursor[Row]] | NoneÚkwargsr   Úreturnr!   c          	     ó’  —  | j         |fi |¤Ž}t          |¦  «        }	d}
t          |¦  «        }g }|D �]?}|                     d¦  «        |                     d¦  «        |                     d¦  «        f}d|z  }t                               d|¦  «         	 t          di |¤Ž}|                      ||	¬¦  «        }t          j	        |t          ¬	¦  «        }
t                               d
|¦  «          n„# t          j        $ rK}t                               d|t          |¦  «        ¦  «         |                     ||f¦  «         Y d}~�Œd}~wt          j        $ r}|                     d¦  «        ‚d}~ww xY w|
sÁ|d         d         }t#          |¦  «        dk    r|                     d¦  «        ‚t          |¦  «        g}|                     d¦  «         |                     d„ |D ¦   «         ¦  «          t'          |¦  «        d                     |¦  «        |j        ¬¦  «        }|                     d¦  «        ‚t-          j        ¦   «         r5|
j        j        r)t3          |¦  «        st5          j        dt8          ¦  «         t;          |¦  «        |
_        |r||
_        |r||
_         |rtC          |j"        ¦  «        |
_#        ||
_$        |
S )zV
        Connect to a database server and return a new `Connection` instance.
        NÚhostÚportÚhostaddrz host: %r, port: %r, hostaddr: %rzconnection attempt: %srD   ©Útimeout©Úintervalzconnection succeeded: %szconnection failed: %s: %séÿÿÿÿr   r   z7Multiple connection attempts failed. All failures were:c              3  ó,   K  — | ]\  }}d |› d|› �V — ŒdS )z- z: N© )Ú.0ÚerrorÚdescrs      rB   ú	<genexpr>z%Connection.connect.<locals>.<genexpr>€   s7   è è € ÐPÐP±L°E¸5Ð/˜uÐ/Ð/¨Ð/Ð/ÐPÐPÐPÐPÐPÐPrC   ú
)r:   au  the connection was obtained using the GSSAPI relying on the 'gssencmode=prefer' libpq default. The value for this default might be 'disable' instead, in certain psycopg[binary] implementations. If you wish to interact with the GSSAPI reliably please set the 'gssencmode' parameter in the connection string or the 'PGGSSENCMODE' environment variable to 'prefer' or 'require'©rD   )%Ú_get_connection_paramsr'   r$   ÚgetÚloggerÚdebugr&   Ú_connect_genr   Ú	wait_connÚ_WAIT_INTERVALÚeÚErrorrJ   ÚappendÚ_NO_TRACEBACKÚwith_tracebackÚlenÚextendÚtypeÚjoinr:   r+   Úhas_used_gssapiÚused_gssapir-   ÚwarningsÚwarnÚRuntimeWarningrK   Ú_autocommitr8   r5   r   ÚadaptersÚ	_adaptersrG   )ÚclsrI   rF   rG   rH   r8   r5   rP   ÚparamsrW   ÚrvÚattemptsÚconn_errorsÚattemptÚtdescrr_   ÚgenÚexÚlast_exÚlinesÚnew_exs                        rB   ÚconnectzConnection.connectQ   sú  € ð  ,�Ô+¨HÐ?Ð?¸Ð?Ð?ˆÝ'¨Ñ/Ô/ˆØˆÝ$ VÑ,Ô,ˆØ13ˆØð 	ñ 	ˆGØ—k’k &Ñ)Ô)¨7¯;ª;°vÑ+>Ô+>ÀÇÂÈJÑ@WÔ@WÐXˆFØ6¸Ñ?ˆEÝ�LŠLÐ1°5Ñ9Ô9Ð9ðÝ(Ð7Ð7¨wÐ7Ð7�Ø×&Ò& x¸Ð&ÑAÔA�ÝÔ& sµ^ÐDÑDÔD�õ —’Ð7¸Ñ?Ô?Ð?Ø�øõ ”7ð 0ð 0ð 0Ý—’Ð8¸%ÅÀRÁÄÑIÔIÐIØ×"Ò" B¨ ;Ñ/Ô/Ð/Ð/Ð/Ð/Ð/Ñ/øøøøÝ”?ð .ð .ð .Ø×'Ò'¨Ñ-Ô-Ð-øøøøð.øøøð ð 	.Ø! "”o aÔ(ˆGÝ�;ÑÔ 1Ò$Ð$Ø×,Ò,¨TÑ2Ô2Ð2õ ˜‘\”\�NˆEØ�LŠLÐRÑSÔSÐSØ�LŠLÐPÐPÀKÐPÑPÔPÑQÔQÐQØ"•T˜'‘]”] 4§9¢9¨UÑ#3Ô#3¸G¼NÐKÑKÔKˆFØ×'Ò'¨Ñ-Ô-Ð-õ Ô(Ñ*Ô*ð	à”	Ô%ð	õ & fÑ-Ô-ð	õ
 ŒMð HÝñô ð õ
 ˜jÑ)Ô)ˆŒØð 	)Ø(ˆBŒNØð 	/Ø .ˆBÔØð 	9Ý& wÔ'7Ñ8Ô8ˆBŒLØ0ˆÔØˆ	s%   Â>C0Ã0E1Ã?A EÅE1ÅE,Å,E1c                ó   — | S r<   r\   ©r@   s    rB   Ú	__enter__zConnection.__enter__˜   s   € ØˆrC   Úexc_typeútype[BaseException] | NoneÚexc_valúBaseException | NoneÚexc_tbúTracebackType | NoneÚNonec                ó$  — | j         rd S |rI	 |                      ¦   «          nG# t          $ r&}t                               d| |¦  «         Y d }~nd }~ww xY w|                      ¦   «          t          | dd ¦  «        s|                      ¦   «          d S d S )Nz#error ignored in rollback on %s: %sÚ_pool)ÚclosedÚrollbackÚ	Exceptionre   ÚwarningÚcommitÚgetattrÚclose)r@   r‹   r�   r�   Úexc2s        rB   Ú__exit__zConnection.__exit__›   s¹   € ð Œ;ð 	ØˆFàð 	ðRØ—’‘”��øÝð Rð Rð RÝ—’ÐDÀdÈDÑQÔQÐQÐQÐQÐQÐQÐQøøøøðRøøøð �KŠK‰MŒMˆMõ �t˜W dÑ+Ô+ð 	Ø�JŠJ‰LŒLˆLˆLˆLð	ð 	s   �" ¢
A¬AÁAr   r   c                ó   — t          |fi |¤ŽS )z3Manipulate connection parameters before connecting.)r%   )r{   rI   rP   s      rB   rc   z!Connection._get_connection_params²   s   € õ   Ð3Ð3¨FÐ3Ð3Ð3rC   c                óÎ   — | j         rdS t          | dd¦  «        }|r(t          |dd¦  «        r|                     | ¦  «         dS d| _        | j                             ¦   «          dS )zClose the database connection.Nr“   Úclose_returnsFT)r”   r™   ÚputconnÚ_closedr:   Úfinish)r@   Úpools     rB   rš   zConnection.close·   sw   € àŒ;ð 	ØˆFå�t˜W dÑ+Ô+ˆØð 	•G˜D /°5Ñ9Ô9ð 	Ø�LŠL˜ÑÔÐØˆFàˆŒð 	Œ×ÒÑÔÐÐÐrC   )Úbinaryr¤   úCursor[Row]c               ó   — d S r<   r\   )r@   r¤   s     rB   ÚcursorzConnection.cursorÇ   s   € Ø>A¸crC   úRowFactory[CursorRow]úCursor[CursorRow]c               ó   — d S r<   r\   )r@   r¤   r8   s      rB   r§   zConnection.cursorÊ   s	   € ð  ˜CrC   )r¤   Ú
scrollableÚwithholdÚnamer«   úbool | Noner¬   úServerCursor[Row]c               ó   — d S r<   r\   )r@   r­   r¤   r«   r¬   s        rB   r§   zConnection.cursorÏ   s	   € ð  ˜CrC   úServerCursor[CursorRow]c               ó   — d S r<   r\   )r@   r­   r¤   r8   r«   r¬   s         rB   r§   zConnection.cursorÙ   s	   € ð #& #rC   )r¤   r8   r«   r¬   úRowFactory[Any] | NoneúCursor[Any] | ServerCursor[Any]c               óÄ   — |                       ¦   «          |s| j        }|r|                      | ||||¬¦  «        }n|                      | |¬¦  «        }|rt          |_        |S )zW
        Return a new `Cursor` to send commands and queries to the connection.
        )r­   r8   r«   r¬   ©r8   )Ú_check_connection_okr8   r6   r5   ÚBINARYÚformat)r@   r­   r¤   r8   r«   r¬   Úcurs          rB   r§   zConnection.cursorä   sŠ   € ð 	×!Ò!Ñ#Ô#Ð#àð 	+ØÔ*ˆKð ð 		EØ×,Ò,ØØØ'Ø%Ø!ð -ñ ô ˆCˆCð ×%Ò% d¸Ð%ÑDÔDˆCàð 	 ÝˆCŒJàˆ
rC   )Úpreparer¤   Úqueryr   r|   úParams | Noner»   c               ó   — d S r<   r\   )r@   r¼   r|   r»   r¤   s        rB   ÚexecutezConnection.execute  s	   € ð �crC   r"   c               ó   — d S r<   r\   )r@   r¼   r»   r¤   s       rB   r¿   zConnection.execute  s	   € ð �crC   r   c               óJ  — 	 |                       ¦   «         }|rt          |_        t          |t          ¦  «        r(|�t          d¦  «        ‚|                     ||¬¦  «        S |                     |||¬¦  «        S # t          j        $ r}| 	                    d¦  «        ‚d}~ww xY w)z8Execute a query and return a cursor to read its results.NzA'execute()' with string template query doesn't support parameters)r»   )
r§   r¸   r¹   Ú
isinstancer"   Ú	TypeErrorr¿   rj   rm   rn   )r@   r¼   r|   r»   r¤   rº   rƒ   s          rB   r¿   zConnection.execute  s¶   € ð	*Ø—+’+‘-”-ˆCØð $Ý#�”
å˜%¥Ñ*Ô*ð CØÐ%Ý#Ø[ñô ð ð —{’{ 5°'�{Ñ:Ô:Ð:à—{’{ 5¨&¸'�{ÑBÔBÐBøÝŒð 	*ð 	*ð 	*Ø×#Ò# DÑ)Ô)Ð)øøøøð	*øøøs   ‚AA9 Á!A9 Á9B"ÂBÂB"c                ó”   — | j         5  |                      |                      ¦   «         ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z/Commit any pending transaction to the database.N)r?   ÚwaitÚ_commit_genr‰   s    rB   r˜   zConnection.commit.  sŒ   € àŒYð 	*ð 	*Ø�IŠI�d×&Ò&Ñ(Ô(Ñ)Ô)Ð)ð	*ð 	*ð 	*ñ 	*ô 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*øøøð 	*ð 	*ð 	*ð 	*ð 	*ð 	*ó   ˆ(=½AÁAc                ó”   — | j         5  |                      |                      ¦   «         ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z2Roll back to the start of any pending transaction.N)r?   rÅ   Ú_rollback_genr‰   s    rB   r•   zConnection.rollback3  sŒ   € àŒYð 	,ð 	,Ø�IŠI�d×(Ò(Ñ*Ô*Ñ+Ô+Ð+ð	,ð 	,ð 	,ñ 	,ô 	,ð 	,ð 	,ð 	,ð 	,ð 	,ð 	,ð 	,øøøð 	,ð 	,ð 	,ð 	,ð 	,ð 	,rÇ   g      >@rV   rW   Úfloatc               óâ   — |                       ¦   «         sdS t          j        ¦   «         r1t          j        |                      |¬¦  «        t          ¬¦  «         dS |                      ¦   «          dS )a»  Cancel the current operation on the connection.

        :param timeout: raise a `~errors.CancellationTimeout` if the
            cancellation request does not succeed within `timeout` seconds.

        Note that a successful cancel attempt on the client is not a guarantee
        that the server will successfully manage to cancel the operation.

        This is a non-blocking version of `~Connection.cancel()` which
        leverages a more secure and improved cancellation feature of the libpq,
        which is only available from version 17.

        If the underlying libpq is older than version 17, the method will fall
        back to using the same implementation of `!cancel()`.
        NrV   rX   )Ú_should_cancelr+   Úhas_cancel_safer   rh   Ú_cancel_genri   Úcancel)r@   rW   s     rB   Úcancel_safezConnection.cancel_safe8  s{   € ð  ×"Ò"Ñ$Ô$ð 	ØˆFåÔ'Ñ)Ô)ð 	ÝÔØ× Ò ¨Ð Ñ1Ô1½Nðñ ô ð ð ð ð �KŠK‰MŒMˆMˆMˆMrC   ç      @c               óš   — 	 |                       |¬¦  «         d S # t          $ r&}t                               d|¦  «         Y d }~d S d }~ww xY w)NrV   zquery cancellation failed: %s)rÐ   r–   re   r—   )r@   rW   rƒ   s      rB   Ú_try_cancelzConnection._try_cancelR  so   € ð	@Ø×Ò WÐÑ-Ô-Ð-Ð-Ð-øÝð 	@ð 	@ð 	@Ý�NŠNÐ:¸BÑ?Ô?Ð?Ð?Ð?Ð?Ð?Ð?Ð?øøøøð	@øøøs   ‚ š
A
¤AÁA
Úsavepoint_nameú
str | NoneÚforce_rollbackúIterator[Transaction]c              #  ój  K  — t          | ||¦  «        }| j        ry|                      ¦   «         5  |5  |                      ¦   «         5  |V — ddd¦  «         n# 1 swxY w Y   ddd¦  «         n# 1 swxY w Y   ddd¦  «         dS # 1 swxY w Y   dS |5  |V — ddd¦  «         dS # 1 swxY w Y   dS )až  
        Start a context block with a new transaction or nested transaction.

        :param savepoint_name: Name of the savepoint used to manage a nested
            transaction. If `!None`, one will be chosen automatically.
        :param force_rollback: Roll back the transaction at the end of the
            block even if there were no error (e.g. to try a no-op process).
        :rtype: Transaction
        N)r*   r9   Úpipeline)r@   rÔ   rÖ   Útxs       rB   ÚtransactionzConnection.transactionX  sÏ  è è € õ ˜˜~¨~Ñ>Ô>ˆØŒ>ð 	Ø—’‘”ð ð  "ð ð  d§m¢m¡o¤oð ð Ø���ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð ð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð ð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð ð ð ð Ø���ðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð sj   ¯B²A/ÁAÁA/ÁAÁA/ÁAÁ A/Á#BÁ/A3	Á3BÁ6A3	Á7BÂBÂBÂB(Â(B,Â/B,)rW   Ú
stop_afterúfloat | NonerÜ   úGenerator[Notify]c             #  ó^  K  — |�'t          ¦   «         |z   }t          |t          ¦  «        }n	d}t          }d}| j        rt	          j        dt          ¦  «         | j        5  | j        j	        }d| j
        c| _
        }	 	 |r |r|                     ¦   «         V — |dz  }|°n©	 |                      t          | j        ¦  «        |¬¦  «        }n,# t          j        $ r}	|	                     d¦  «        ‚d}	~	ww xY w|D ]O}
t#          |
j                             |¦  «        |
j                             |¦  «        |
j        ¦  «        V — |dz  }ŒP|�||k    rn/|r+t          t          |t          ¦   «         z
  ¦  «        }|dk     rn�Œ|| _
        n# || _
        w xY w	 ddd¦  «         dS # 1 swxY w Y   dS )a›  
        Yield `Notify` objects as soon as they are received from the database.

        :param timeout: maximum amount of time to wait for notifications.
            `!None` means no timeout.
        :param stop_after: stop after receiving this number of notifications.
            You might actually receive more than this number if more than one
            notifications arrives in the same packet.
        Nr   zusing 'notifies()' together with notifies handlers on the same connection is not reliable. Please use only one of these methodsTr   rX   g        )r   Úminri   Ú_notify_handlersru   rv   rw   r?   r:   Ú	_encodingÚ_notifies_backlogÚpopleftrÅ   r)   rj   rm   rn   r0   ÚrelnameÚdecodeÚextraÚbe_pid)r@   rW   rÜ   ÚdeadlinerY   Ú	nreceivedÚencÚdÚpgnsrƒ   Úpgns              rB   r)   zConnection.notifiesm  sb  è è € ð ÐÝ ‘{”{ WÑ,ˆHÝ˜7¥NÑ3Ô3ˆHˆHàˆHÝ%ˆHàˆ	àÔ ð 	ÝŒMð RÝñô ð ð
 ŒYð (	+ð (	+Ø”+Ô'ˆCð *.¨tÔ/EÐ%ˆDÔ" Að!+ð"ð ð +Øð +Ø"#§)¢)¡+¤+Ð-Ð-Ð-Ø%¨™N˜Ið  ð +øð:Ø#'§9¢9­X°d´kÑ-BÔ-BÈX 9Ñ#VÔ#V˜D˜DøÝ œð :ð :ð :Ø"$×"3Ò"3°DÑ"9Ô"9Ð9øøøøð:øøøð $(ð +ð +˜CÝ"(Ø #¤× 2Ò 2°3Ñ 7Ô 7Ø #¤	× 0Ò 0°Ñ 5Ô 5Ø #¤
ñ#ô #ð ð ð ð
 &¨™N˜I˜Ið "Ð-°)¸zÒ2IÐ2IØð  ð "Ý#&¥~°xÅ)Á+Ä+Ñ7MÑ#NÔ#N˜Ø# cš>˜>Ø!ñ="ð@ *+�Ô&Ð&ø¨�Ô&Ð*Ð*Ð*Ð*Ð&ðQ(	+ð (	+ð (	+ñ (	+ô (	+ð (	+ð (	+ð (	+ð (	+ð (	+ð (	+ð (	+øøøð (	+ð (	+ð (	+ð (	+ð (	+ð (	+sO   ÁF"Á<#FÂ )C
Ã	FÃ
C3ÃC.Ã.C3Ã3BFÆ F"Æ	FÆF"Æ"F&Æ)F&úIterator[Pipeline]c              #  óî  K  — | j         5  |                      ¦   «          | j        x}€t          | ¦  «        x}| _        ddd¦  «         n# 1 swxY w Y   	 |5  |V — ddd¦  «         n# 1 swxY w Y   |j        dk    r4| j         5  || j        u sJ ‚d| _        ddd¦  «         dS # 1 swxY w Y   dS dS # |j        dk    r2| j         5  || j        u sJ ‚d| _        ddd¦  «         w # 1 swxY w Y   w w xY w)z<Context manager to switch the connection into pipeline mode.Nr   )r?   r·   r9   r(   Úlevel©r@   rÙ   s     rB   rÙ   zConnection.pipeline´  s-  è è € ð ŒYð 	;ð 	;Ø×%Ò%Ñ'Ô'Ð'à œNÐ*�Ð3å,4°T©N¬NÐ:�˜4œ>ð	;ð 	;ð 	;ñ 	;ô 	;ð 	;ð 	;ð 	;ð 	;ð 	;ð 	;øøøð 	;ð 	;ð 	;ð 	;ð	*Øð ð Ø���ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð Œ~ Ò"Ð"Ø”Yð *ð *Ø# t¤~Ð5Ð5Ð5Ð5Ø%)�D”Nð*ð *ð *ñ *ô *ð *ð *ð *ð *ð *ð *ð *øøøð *ð *ð *ð *ð *ð *ð #Ð"øˆxŒ~ Ò"Ð"Ø”Yð *ð *Ø# t¤~Ð5Ð5Ð5Ð5Ø%)�D”Nð*ð *ð *ñ *ô *ð *ð *ð *ð *ð *ð *øøøð *ð *ð *ð *ð *ð #øøøsw   Š4A
Á
AÁAÁB5 ÁA)ÁB5 Á)A-Á-B5 Á0A-Á1B5 ÂB&Â&B*Â-B*Â5C4ÃC'ÃC4Ã'C+Ã+C4Ã.C+Ã/C4c              #  ó  K  — | j         rJ ‚t          | d¬¦  «        x}| _         	 |5  |V — ddd¦  «         n# 1 swxY w Y   |j        dk    sJ ‚|| j         u sJ ‚d| _         dS # |j        dk    sJ ‚|| j         u sJ ‚d| _         w xY w)zglike pipeline() but don't acquire a lock.

        Assume that the caller is holding the lock.
        T)Ú_no_lockNr   )r9   r(   rñ   rò   s     rB   Ú_pipeline_nolockzConnection._pipeline_nolockÇ  s  è è € ð ”>Ð!Ð!Ð!å$,¨T¸DÐ$AÑ$AÔ$AÐAˆ�4”>ð	"Øð ð Ø���ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð ”> QÒ&Ð&Ð&Ð&Ø˜tœ~Ð-Ð-Ð-Ð-Ø!ˆDŒNˆNˆNøð ”> QÒ&Ð&Ð&Ð&Ø˜tœ~Ð-Ð-Ð-Ð-Ø!ˆDŒNÐ!Ð!Ð!Ð!s'   ¥A$ §8¬A$ ¸<¼A$ ¿<Á A$ Á$!Br‚   ú	PQGen[RV]rY   r   c                ó*  — 	 t          j        || j        j        |¬¦  «        S # t          $ re | j        j        t          k    rN|                      d¬¦  «         	 t          j        || j        j        |¬¦  «         n# t          j	        $ r Y nw xY w‚ w xY w)z¼
        Consume a generator operating on the connection.

        The function must be used on generators that don't change connection
        fd (i.e. not on connect and reset).
        rX   rÑ   rV   )
r   rÅ   r:   ÚsocketÚ_INTERRUPTEDÚtransaction_statusÚACTIVErÓ   rj   ÚQueryCanceled)r@   r‚   rY   s      rB   rÅ   zConnection.waitÜ  s°   € ð	Ý”<  T¤[Ô%7À(ÐKÑKÔKÐKøÝð 		ð 		ð 		ØŒ{Ô-µÒ7Ð7ð × Ò ¨Ð Ñ-Ô-Ð-ðÝ”L  d¤kÔ&8À8ÐLÑLÔLÐLÐLøÝ”ð ð ð Ø�Dðøøøàð		øøøs-   ‚ # £5BÁ!A;Á:BÁ;BÂ
BÂBÂBÚvaluec                ó0   — |                       |¦  «         d S r<   )Úset_autocommit©r@   rý   s     rB   Ú_set_autocommitzConnection._set_autocommitð  ó   € Ø×Ò˜EÑ"Ô"Ð"Ð"Ð"rC   c                ó–   — | j         5  |                      |                      |¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z6Method version of the `~Connection.autocommit` setter.N)r?   rÅ   Ú_set_autocommit_genr   s     rB   rÿ   zConnection.set_autocommitó  óŽ   € àŒYð 	7ð 	7Ø�IŠI�d×.Ò.¨uÑ5Ô5Ñ6Ô6Ð6ð	7ð 	7ð 	7ñ 	7ô 	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7øøøð 	7ð 	7ð 	7ð 	7ð 	7ð 	7ó   ˆ)>¾AÁAúIsolationLevel | Nonec                ó0   — |                       |¦  «         d S r<   )Úset_isolation_levelr   s     rB   Ú_set_isolation_levelzConnection._set_isolation_levelø  s   € Ø× Ò  Ñ'Ô'Ð'Ð'Ð'rC   c                ó–   — | j         5  |                      |                      |¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z;Method version of the `~Connection.isolation_level` setter.N)r?   rÅ   Ú_set_isolation_level_genr   s     rB   r	  zConnection.set_isolation_levelû  sŽ   € àŒYð 	<ð 	<Ø�IŠI�d×3Ò3°EÑ:Ô:Ñ;Ô;Ð;ð	<ð 	<ð 	<ñ 	<ô 	<ð 	<ð 	<ð 	<ð 	<ð 	<ð 	<ð 	<øøøð 	<ð 	<ð 	<ð 	<ð 	<ð 	<r  c                ó0   — |                       |¦  «         d S r<   )Úset_read_onlyr   s     rB   Ú_set_read_onlyzConnection._set_read_only   s   € Ø×Ò˜5Ñ!Ô!Ð!Ð!Ð!rC   c                ó–   — | j         5  |                      |                      |¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z5Method version of the `~Connection.read_only` setter.N)r?   rÅ   Ú_set_read_only_genr   s     rB   r  zConnection.set_read_only  sŽ   € àŒYð 	6ð 	6Ø�IŠI�d×-Ò-¨eÑ4Ô4Ñ5Ô5Ð5ð	6ð 	6ð 	6ñ 	6ô 	6ð 	6ð 	6ð 	6ð 	6ð 	6ð 	6ð 	6øøøð 	6ð 	6ð 	6ð 	6ð 	6ð 	6r  c                ó0   — |                       |¦  «         d S r<   )Úset_deferrabler   s     rB   Ú_set_deferrablezConnection._set_deferrable  r  rC   c                ó–   — | j         5  |                      |                      |¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z6Method version of the `~Connection.deferrable` setter.N)r?   rÅ   Ú_set_deferrable_genr   s     rB   r  zConnection.set_deferrable  r  r  Úxidú	Xid | strc                ó–   — | j         5  |                      |                      |¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )zO
        Begin a TPC transaction with the given transaction ID `!xid`.
        N)r?   rÅ   Ú_tpc_begin_gen©r@   r  s     rB   Ú	tpc_beginzConnection.tpc_begin  s�   € ð ŒYð 	0ð 	0Ø�IŠI�d×)Ò)¨#Ñ.Ô.Ñ/Ô/Ð/ð	0ð 	0ð 	0ñ 	0ô 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0øøøð 	0ð 	0ð 	0ð 	0ð 	0ð 	0r  c                ó  — 	 | j         5  |                      |                      ¦   «         ¦  «         ddd¦  «         dS # 1 swxY w Y   dS # t          j        $ r'}t          j        t          |¦  «        ¦  «        d‚d}~ww xY w)zV
        Perform the first phase of a transaction started with `tpc_begin()`.
        N)r?   rÅ   Ú_tpc_prepare_genrj   ÚObjectNotInPrerequisiteStateÚNotSupportedErrorrJ   )r@   rƒ   s     rB   Útpc_preparezConnection.tpc_prepare  sÌ   € ð	9Ø”ð 3ð 3Ø—	’	˜$×/Ò/Ñ1Ô1Ñ2Ô2Ð2ð3ð 3ð 3ñ 3ô 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3øøøð 3ð 3ð 3ð 3ð 3ð 3øåÔ-ð 	9ð 	9ð 	9ÝÔ%¥c¨"¡g¤gÑ.Ô.°DÐ8øøøøð	9øøøs7   ‚A ‰(>±A ¾AÁA ÁAÁA ÁBÁ"A<Á<BúXid | str | Nonec                ó˜   — | j         5  |                      |                      d|¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z:
        Commit a prepared two-phase transaction.
        ÚCOMMITN©r?   rÅ   Ú_tpc_finish_genr  s     rB   Ú
tpc_commitzConnection.tpc_commit!  s’   € ð ŒYð 	;ð 	;Ø�IŠI�d×*Ò*¨8°SÑ9Ô9Ñ:Ô:Ð:ð	;ð 	;ð 	;ñ 	;ô 	;ð 	;ð 	;ð 	;ð 	;ð 	;ð 	;ð 	;øøøð 	;ð 	;ð 	;ð 	;ð 	;ð 	;ó   ˆ*?¿AÁAc                ó˜   — | j         5  |                      |                      d|¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z=
        Roll back a prepared two-phase transaction.
        ÚROLLBACKNr%  r  s     rB   Útpc_rollbackzConnection.tpc_rollback(  s’   € ð ŒYð 	=ð 	=Ø�IŠI�d×*Ò*¨:°sÑ;Ô;Ñ<Ô<Ð<ð	=ð 	=ð 	=ñ 	=ô 	=ð 	=ð 	=ð 	=ð 	=ð 	=ð 	=ð 	=øøøð 	=ð 	=ð 	=ð 	=ð 	=ð 	=r(  ú	list[Xid]c                ó¬  — |                       ¦   «          | j        j        }|                      t	          t
          j        ¦  «        ¬¦  «        5 }|                     t          j        ¦   «         ¦  «         | 	                    ¦   «         }d d d ¦  «         n# 1 swxY w Y   |t          k    r)| j        j        t          k    r|                      ¦   «          |S )Nr¶   )Ú
_check_tpcÚinforú   r§   r   r   Ú_from_recordr¿   Ú_get_recover_queryÚfetchallÚIDLEÚINTRANSr•   )r@   Ústatusrº   Úress       rB   Útpc_recoverzConnection.tpc_recover/  sá   € Ø�ŠÑÔÐØ”Ô-ˆØ�[Š[¥X­cÔ.>Ñ%?Ô%?ˆ[Ñ@Ô@ð 	!ÀCØ�KŠK�Ô.Ñ0Ô0Ñ1Ô1Ð1Ø—,’,‘.”.ˆCð	!ð 	!ð 	!ñ 	!ô 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!øøøð 	!ð 	!ð 	!ð 	!ð •TŠ>ˆ>˜dœiÔ:½gÒEÐEØ�MŠM‰OŒOˆOàˆ
s   Á;BÂBÂB)r:   r1   r8   r7   rb   )rI   rJ   rF   rK   rG   rL   rH   rM   r8   rN   r5   rO   rP   r   rQ   r!   )rQ   r!   )r‹   rŒ   r�   rŽ   r�   r�   rQ   r‘   )rI   rJ   rP   r   rQ   r   )rQ   r‘   )r¤   rK   rQ   r¥   )r¤   rK   r8   r¨   rQ   r©   )
r­   rJ   r¤   rK   r«   r®   r¬   rK   rQ   r¯   )r­   rJ   r¤   rK   r8   r¨   r«   r®   r¬   rK   rQ   r±   )r­   rJ   r¤   rK   r8   r³   r«   r®   r¬   rK   rQ   r´   r<   )
r¼   r   r|   r½   r»   r®   r¤   rK   rQ   r¥   )r¼   r"   r»   r®   r¤   rK   rQ   r¥   )
r¼   r   r|   r½   r»   r®   r¤   rK   rQ   r¥   )rW   rÊ   rQ   r‘   )NF)rÔ   rÕ   rÖ   rK   rQ   r×   )rW   rÝ   rÜ   rL   rQ   rÞ   )rQ   rï   )r‚   rö   rY   rÊ   rQ   r   )rý   rK   rQ   r‘   )rý   r  rQ   r‘   )rý   r®   rQ   r‘   )r  r  rQ   r‘   )r  r"  rQ   r‘   )rQ   r,  ),Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   r   r   r>   Úclassmethodr‡   rŠ   rœ   rc   rš   r	   r§   r¿   r˜   r•   rÐ   rÓ   r
   rÛ   r)   rÙ   rõ   ri   rÅ   r  rÿ   r
  r	  r  r  r  r  r  r!  r'  r+  r7  Ú__classcell__)rA   s   @rB   r4   r4   :   s   ø€ € € € € € ðð ð €Jà%Ð%Ð%Ñ%Ø2Ð2Ð2Ñ2Ø Ð Ð Ñ ØÐÐÑð
 (, t¨J°s¬O¸YÑ'GÔ'Gð	2ð 	2ð 	2ð 	2ð 	2ð 	2ð 	2ð ð ðDð !Ø()Ø'+Ø.2Ø37ðDð Dð Dð Dð Dñ „[ðDðLð ð ð ðð ð ð ð. ð4ð 4ð 4ñ „[ð4ðð ð ð ð  Ø',ÐAÐAÐAÐAÐAñ „XØAàà %ð ð  ð  ð  ð  ñ „Xð ð ð
 Ø"&Øð ð  ð  ð  ð  ñ „Xð ð ð
 à"&Øð&ð &ð &ð &ð &ñ „Xð&ð ð ð Ø.2Ø"&Øð ð  ð  ð  ð  ð  ðD ð !%ðð
  $Øðð ð ð ð ñ „Xðð à9=Èeðð ð ð ð ñ „Xðð !%ð*ð
  $Øð*ð *ð *ð *ð *ð *ð2*ð *ð *ð *ð
,ð ,ð ,ð ,ð
 /3ð ð ð ð ð ð ð4 /2ð @ð @ð @ð @ð @ð @ð àHMðð ð ð ñ „^ðð* *.ÈðE+ð E+ð E+ð E+ð E+ð E+ðN ð*ð *ð *ñ „^ð*ð$ ð"ð "ð "ñ „^ð"ð( 6Dð ð ð ð ð ð(#ð #ð #ð #ð7ð 7ð 7ð 7ð
(ð (ð (ð (ð<ð <ð <ð <ð
"ð "ð "ð "ð6ð 6ð 6ð 6ð
#ð #ð #ð #ð7ð 7ð 7ð 7ð
0ð 0ð 0ð 0ð9ð 9ð 9ð 9ð;ð ;ð ;ð ;ð ;ð=ð =ð =ð =ð =ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
rC   r4   )Wr;  Ú
__future__r   Úloggingru   Útimer   Útypesr   Útypingr   r   r   r	   Ú
contextlibr
   Úcollections.abcr   r   rD   r   rj   r   r   Úabcr   r   r   r   r   r   r   r   Ú_tpcr   Úrowsr   r   r   r   Úadaptr   Ú_enumsr   r§   r    Ú_compatr!   r"   Ú_acompatr#   rI   r$   r%   r&   r'   r9   r(   Ú
generatorsr)   rÛ   r*   Ú_capabilitiesr+   Ú_server_cursorr,   Ú_conninfo_utilsr-   Ú_connection_baser.   r/   r0   Úpq.abcr1   ri   ÚFormatÚTEXTr¸   ÚTransactionStatusr3  rû   r4  ÚKeyboardInterruptrù   Ú	getLoggerre   r4   r\   rC   rB   ú<module>rX     s  ððð ð #Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø %Ð %Ð %Ð %Ð %Ð %Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ð Ð Ø LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LÐ LØ  Ð  Ð  Ð  Ð  Ð  Ø Ð Ð Ð Ð Ð Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "Ø Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð Ð Ð Ø HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HØ +Ð +Ð +Ð +Ð +Ð +Ø Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ø $Ð $Ð $Ð $Ð $Ð $Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø (Ð (Ð (Ð (Ð (Ð (Ø -Ð -Ð -Ð -Ð -Ð -Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?àð ØÐÐÐÐÐà€à	„y„~€Ø	ŒÔ	€à	ÔÔ €Ø	Ô	Ô	$€Ø
Ô
Ô
&€à €à	ˆÔ	˜9Ñ	%Ô	%€ðð ð ð ð � Ô$ñ ô ð ð ð rC   