§
    YŠtj  ã                  óx   — d 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  G d
„ d¦  «        ZdS )z>
Objects to return information about a PostgreSQL connection.
é    )Úannotations)ÚPath)Útzinfoé   )Úerrors)Úpq)Ú
get_tzinfo)Úmake_conninfoc                  óæ  — e Zd ZdZdZd'd„Zed(d„¦   «         Zed(d	„¦   «         Zed(d
„¦   «         Zed)d„¦   «         Z	ed(d„¦   «         Z
ed(d„¦   «         Zed(d„¦   «         Zed(d„¦   «         Zd*d„Zed(d„¦   «         Zed+d„¦   «         Zed,d„¦   «         Zed-d„¦   «         Zd.d„Zed)d„¦   «         Zed)d„¦   «         Zed)d„¦   «         Zed(d „¦   «         Zed/d"„¦   «         Zed(d#„¦   «         Zd0d%„Zd&S )1ÚConnectionInfoz1Allow access to information about the connection.ÚpsycopgÚpgconnúpq.abc.PGconnc                ó   — || _         d S ©N)r   )Úselfr   s     úV/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/psycopg/_connection_info.pyÚ__init__zConnectionInfo.__init__   s   € ØˆŒˆˆó    ÚreturnÚstrc                ó   — dS )z7A string representing the database vendor connected to.Ú
PostgreSQL© ©r   s    r   ÚvendorzConnectionInfo.vendor   s	   € ð ˆ|r   c                ó,   — |                       d¦  «        S )zBThe server host name of the active connection. See :pq:`PQhost()`.Úhost©Ú_get_pgconn_attrr   s    r   r   zConnectionInfo.host   ó   € ð ×$Ò$ VÑ,Ô,Ð,r   c                ó,   — |                       d¦  «        S )z@The server IP address of the connection. See :pq:`PQhostaddr()`.Úhostaddrr   r   s    r   r#   zConnectionInfo.hostaddr$   ó   € ð ×$Ò$ ZÑ0Ô0Ð0r   Úintc                óÔ   — |                       d¦  «        x}rt          |¦  «        S t          j                             ¦   «         x}rt          |¦  «        S t          j        d¦  «        ‚)z6The port of the active connection. See :pq:`PQport()`.Úportz!couldn't find the connection port)r    r%   r   ÚmiscÚget_compiled_portÚeÚInternalError)r   r'   s     r   r'   zConnectionInfo.port)   se   € ð ×(Ò(¨Ñ0Ô0Ð0ˆ4ð 	Ý�t‘9”9Ðõ
 ”W×.Ò.Ñ0Ô0Ð0ˆTð 	Ý�t‘9”9ÐåŒoÐAÑBÔBÐBr   c                ó,   — |                       d¦  «        S )z6The database name of the connection. See :pq:`PQdb()`.Údbr   r   s    r   ÚdbnamezConnectionInfo.dbname7   s   € ð ×$Ò$ TÑ*Ô*Ð*r   c                ó,   — |                       d¦  «        S )z4The user name of the connection. See :pq:`PQuser()`.Úuserr   r   s    r   r0   zConnectionInfo.user<   r!   r   c                ó,   — |                       d¦  «        S )z3The password of the connection. See :pq:`PQpass()`.Úpasswordr   r   s    r   r2   zConnectionInfo.passwordA   r$   r   c                ó,   — |                       d¦  «        S )zi
        The command-line options passed in the connection request.
        See :pq:`PQoptions`.
        Úoptionsr   r   s    r   r4   zConnectionInfo.optionsF   s   € ð ×$Ò$ YÑ/Ô/Ð/r   údict[str, str]c                ó2  ‡‡— | j         Šd„ t          j                             ¦   «         D ¦   «         Š‰                     dd¦  «         t          t          j        ¦   «         dz  ¦  «                             ¦   «         ‰d<   ˆˆfd„| j	        j
        D ¦   «         S )a\  Return the connection parameters values.

        Return all the parameters set to a non-default value, which might come
        either from the connection string and parameters passed to
        `~Connection.connect()` or from environment variables. The password
        is never returned (you can read it using the `password` attribute).
        c                ó6   — i | ]}|j         ®	|j        |j         “ŒS r   )ÚcompiledÚkeyword)Ú.0Úis     r   ú
<dictcomp>z1ConnectionInfo.get_parameters.<locals>.<dictcomp>Y   s0   € ð 
ð 
ð 
àØŒzÐ%ð ŒI�q”zà%Ð%Ð%r   s   channel_bindings   preferz.pgpasss   passfilec                óà   •— i | ]j}|j         �a|j        dk    rV|j         ‰                     |j        ¦  «        k    ¯7|j                             ‰¦  «        |j                              ‰¦  «        “ŒkS )Ns   password)Úvalr9   ÚgetÚdecode)r:   r;   ÚdefaultsÚpyencs     €€r   r<   z1ConnectionInfo.get_parameters.<locals>.<dictcomp>b   su   ø€ ð 
ð 
ð 
àØŒuÐ Ø”	˜[Ò(Ð(Ø”˜Ÿš a¤iÑ0Ô0Ò0Ð0ð	 ŒI×Ò˜UÑ#Ô# Q¤U§\¢\°%Ñ%8Ô%8ð 1Ð0Ð0r   )Úencodingr   ÚConninfoÚget_defaultsÚ
setdefaultr   r   ÚhomeÚencoder   Úinfo)r   rA   rB   s    @@r   Úget_parameterszConnectionInfo.get_parametersN   s°   øø€ ð ”ˆð
ð 
å”[×-Ò-Ñ/Ô/ð
ñ 
ô 
ˆð 	×ÒÐ.°	Ñ:Ô:Ð:Ý #¥D¤I¡K¤K°)Ñ$;Ñ <Ô <× CÒ CÑ EÔ Eˆ�Ñð
ð 
ð 
ð 
ð 
à”[Ô%ð
ñ 
ô 
ð 	
r   c                ó>   — t          di |                      ¦   «         ¤ŽS )a�  Return the connection string to connect to the database.

        The string contains all the parameters set to a non-default value,
        which might come either from the connection string and parameters
        passed to `~Connection.connect()` or from environment variables. The
        password is never returned (you can read it using the `password`
        attribute).
        r   )r
   rJ   r   s    r   ÚdsnzConnectionInfo.dsnj   s$   € õ Ð5Ð5˜t×2Ò2Ñ4Ô4Ð5Ð5Ð5r   úpq.ConnStatusc                ó>   — t          j        | j        j        ¦  «        S )z3The status of the connection. See :pq:`PQstatus()`.)r   Ú
ConnStatusr   Ústatusr   s    r   rP   zConnectionInfo.statusv   s   € õ Œ}˜Tœ[Ô/Ñ0Ô0Ð0r   úpq.TransactionStatusc                ó>   — t          j        | j        j        ¦  «        S )zl
        The current in-transaction status of the session.
        See :pq:`PQtransactionStatus()`.
        )r   ÚTransactionStatusr   Útransaction_statusr   s    r   rT   z!ConnectionInfo.transaction_status{   s   € õ Ô# D¤KÔ$BÑCÔCÐCr   úpq.PipelineStatusc                ó>   — t          j        | j        j        ¦  «        S )zb
        The current pipeline status of the client.
        See :pq:`PQpipelineStatus()`.
        )r   ÚPipelineStatusr   Úpipeline_statusr   s    r   rX   zConnectionInfo.pipeline_statusƒ   s   € õ Ô  ¤Ô!<Ñ=Ô=Ð=r   Ú
param_nameú
str | Nonec                ó¢   — | j                              |                     | j        ¦  «        ¦  «        }|�|                     | j        ¦  «        ndS )zs
        Return a parameter setting of the connection.

        Return `None` is the parameter is unknown.
        N)r   Úparameter_statusrH   rC   r@   )r   rY   Úress      r   r\   zConnectionInfo.parameter_status‹   sF   € ð Œk×*Ò*¨:×+<Ò+<¸T¼]Ñ+KÔ+KÑLÔLˆØ,/¨Oˆs�zŠz˜$œ-Ñ(Ô(Ð(ÀÐEr   c                ó   — | j         j        S )zZ
        An integer representing the server version. See :pq:`PQserverVersion()`.
        )r   Úserver_versionr   s    r   r_   zConnectionInfo.server_version”   s   € ð
 Œ{Ô)Ð)r   c                ód   — 	 | j         j        S # t          j        $ r | j         j        dz  cY S w xY w)a  
        An integer representing the server full protocol version.

        Return a value in the format described in :pq:`PQfullProtocolVersion()`.

        Only meaningful if the libpq used is version 18 or greater. If the
        version is lesser than that, return the value reported by
        :pq:`PQprotocolVersion()` (but in the same format as above, e.g. 30000
        for version 3). You can use `Capabilities.has_full_protocol_version()`
        to verify if the value can be considered reliable.
        i'  )r   Úfull_protocol_versionr*   ÚNotSupportedErrorÚprotocol_versionr   s    r   ra   z$ConnectionInfo.full_protocol_version›   sF   € ð	8Ø”;Ô4Ð4øÝÔ"ð 	8ð 	8ð 	8Ø”;Ô/°%Ñ7Ð7Ð7Ð7ð	8øøøs   ‚ Ž/®/c                ó   — | j         j        S )zy
        The process ID (PID) of the backend process handling this connection.
        See :pq:`PQbackendPID()`.
        )r   Úbackend_pidr   s    r   re   zConnectionInfo.backend_pid­   s   € ð Œ{Ô&Ð&r   c                ó,   — |                       d¦  «        S )z‚
        The error message most recently generated by an operation on the connection.
        See :pq:`PQerrorMessage()`.
        Úerror_messager   r   s    r   rg   zConnectionInfo.error_messageµ   s   € ð ×$Ò$ _Ñ5Ô5Ð5r   r   c                ó*   — t          | j        ¦  «        S )z6The Python timezone info of the connection's timezone.)r	   r   r   s    r   ÚtimezonezConnectionInfo.timezone½   s   € õ ˜$œ+Ñ&Ô&Ð&r   c                ó   — | j         j        S )z:The Python codec name of the connection's client encoding.)r   Ú	_encodingr   s    r   rC   zConnectionInfo.encodingÂ   s   € ð Œ{Ô$Ð$r   Únamec                ó`   — t          | j        |¦  «        }|                     | j        ¦  «        S r   )Úgetattrr   r@   rC   )r   rl   Úvalues      r   r    zConnectionInfo._get_pgconn_attrÇ   s'   € Ý˜tœ{¨DÑ1Ô1ˆØ�|Š|˜DœMÑ*Ô*Ð*r   N)r   r   )r   r   )r   r%   )r   r5   )r   rM   )r   rQ   )r   rU   )rY   r   r   rZ   )r   r   )rl   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r   r#   r'   r.   r0   r2   r4   rJ   rL   rP   rT   rX   r\   r_   ra   re   rg   ri   rC   r    r   r   r   r   r      s»  € € € € € Ø;Ð;à€Jðð ð ð ð ðð ð ñ „Xðð ð-ð -ð -ñ „Xð-ð ð1ð 1ð 1ñ „Xð1ð ðCð Cð Cñ „XðCð ð+ð +ð +ñ „Xð+ð ð-ð -ð -ñ „Xð-ð ð1ð 1ð 1ñ „Xð1ð ð0ð 0ð 0ñ „Xð0ð
ð 
ð 
ð 
ð8 ð	6ð 	6ð 	6ñ „Xð	6ð ð1ð 1ð 1ñ „Xð1ð ðDð Dð Dñ „XðDð ð>ð >ð >ñ „Xð>ðFð Fð Fð Fð ð*ð *ð *ñ „Xð*ð ð8ð 8ð 8ñ „Xð8ð" ð'ð 'ð 'ñ „Xð'ð ð6ð 6ð 6ñ „Xð6ð ð'ð 'ð 'ñ „Xð'ð ð%ð %ð %ñ „Xð%ð+ð +ð +ð +ð +ð +r   r   N)rs   Ú
__future__r   Úpathlibr   Údatetimer   Ú r   r*   r   Ú_tzr	   Úconninfor
   r   r   r   r   ú<module>r{      sË   ððð ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #ðw+ð w+ð w+ð w+ð w+ñ w+ô w+ð w+ð w+ð w+r   