
    ,h,                    p    S r SSKJr  SSKJr  SSKJr  SSKJr	  SSKJ
r
  SSKJr  SS	KJr   " S
 S5      rg)z>
Objects to return information about a PostgreSQL connection.
    )annotations)Path)tzinfo   )errors)pq)
get_tzinfo)make_conninfoc                     \ rS rSrSrSrSS jr\SS j5       r\SS j5       r\SS j5       r	\SS j5       r
\SS	 j5       r\SS
 j5       r\SS j5       r\SS j5       rSS jr\SS j5       r\SS j5       r\S S j5       r\S!S j5       rS"S jr\SS j5       r\SS j5       r\SS j5       r\S#S j5       r\SS j5       rS$S jrSrg)%ConnectionInfo   z1Allow access to information about the connection.psycopgc                    Xl         g Npgconn)selfr   s     S/var/www/html/Ai_home/venv/lib/python3.13/site-packages/psycopg/_connection_info.py__init__ConnectionInfo.__init__   s        c                    g)z7A string representing the database vendor connected to.
PostgreSQL r   s    r   vendorConnectionInfo.vendor   s     r   c                $    U R                  S5      $ )zBThe server host name of the active connection. See :pq:`PQhost()`.host_get_pgconn_attrr   s    r   r   ConnectionInfo.host        $$V,,r   c                $    U R                  S5      $ )z@The server IP address of the connection. See :pq:`PQhostaddr()`.hostaddrr    r   s    r   r%   ConnectionInfo.hostaddr$        $$Z00r   c                    U R                  S5      =n(       a  [        U5      $ [        R                  R	                  5       =n(       a  [        U5      $ [
        R                  " S5      e)z6The port of the active connection. See :pq:`PQport()`.portz!couldn't find the connection port)r!   intr   miscget_compiled_porteInternalError)r   r)   s     r   r)   ConnectionInfo.port)   sX     ((0040t9
 WW..00T0t9ooABBr   c                $    U R                  S5      $ )z6The database name of the connection. See :pq:`PQdb()`.dbr    r   s    r   dbnameConnectionInfo.dbname7   s     $$T**r   c                $    U R                  S5      $ )z4The user name of the connection. See :pq:`PQuser()`.userr    r   s    r   r5   ConnectionInfo.user<   r#   r   c                $    U R                  S5      $ )z3The password of the connection. See :pq:`PQpass()`.passwordr    r   s    r   r8   ConnectionInfo.passwordA   r'   r   c                $    U R                  S5      $ )zQ
The command-line options passed in the connection request.
See :pq:`PQoptions`.
optionsr    r   s    r   r;   ConnectionInfo.optionsF   s     $$Y//r   c                   U R                   n[        R                  R                  5        Vs0 sH)  nUR                  c  M  UR
                  UR                  _M+     nnUR                  SS5        [        [        R                  " 5       S-  5      R                  5       US'   U R                  R                   Vs0 sH  nUR                  c  M  UR
                  S:w  d  M$  UR                  UR                  UR
                  5      :w  d  MO  UR
                  R                  U5      UR                  R                  U5      _M     sn$ s  snf s  snf )a4  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).
s   channel_bindings   preferz.pgpasss   passfiles   password)encodingr   Conninfoget_defaultscompiledkeyword
setdefaultstrr   homeencoder   infovalgetdecode)r   pyencidefaultss       r   get_parametersConnectionInfo.get_parametersN   s    
 [[--/
/zz "AIIqzz!/ 	 
 	.	: #DIIK)$; < C C E [[%%
%uu 9 		[( 9 aii00	 9AIIU#QUU\\%%88%
 	


s#   EE:EE 'E9Ec                4    [        S0 U R                  5       D6$ )aQ  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
   rN   r   s    r   dsnConnectionInfo.dsnj   s     5t22455r   c                V    [         R                  " U R                  R                  5      $ )z3The status of the connection. See :pq:`PQstatus()`.)r   
ConnStatusr   statusr   s    r   rU   ConnectionInfo.statusv   s     }}T[[//00r   c                V    [         R                  " U R                  R                  5      $ )zT
The current in-transaction status of the session.
See :pq:`PQtransactionStatus()`.
)r   TransactionStatusr   transaction_statusr   s    r   rY   !ConnectionInfo.transaction_status{   s     ##DKK$B$BCCr   c                V    [         R                  " U R                  R                  5      $ )zJ
The current pipeline status of the client.
See :pq:`PQpipelineStatus()`.
)r   PipelineStatusr   pipeline_statusr   s    r   r]   ConnectionInfo.pipeline_status   s       !<!<==r   c                    U R                   R                  UR                  U R                  5      5      nUb  UR	                  U R                  5      $ S$ )z[
Return a parameter setting of the connection.

Return `None` is the parameter is unknown.
N)r   parameter_statusrF   r>   rJ   )r   
param_nameress      r   r`   ConnectionInfo.parameter_status   sC     kk**:+<+<T]]+KL,/Oszz$--(EEr   c                .    U R                   R                  $ )zJ
An integer representing the server version. See :pq:`PQserverVersion()`.
)r   server_versionr   s    r   re   ConnectionInfo.server_version   s    
 {{)))r   c                .    U R                   R                  $ )za
The process ID (PID) of the backend process handling this connection.
See :pq:`PQbackendPID()`.
)r   backend_pidr   s    r   rh   ConnectionInfo.backend_pid   s     {{&&&r   c                $    U R                  S5      $ )zj
The error message most recently generated by an operation on the connection.
See :pq:`PQerrorMessage()`.
error_messager    r   s    r   rk   ConnectionInfo.error_message   s     $$_55r   c                ,    [        U R                  5      $ )z6The Python timezone info of the connection's timezone.)r	   r   r   s    r   timezoneConnectionInfo.timezone   s     $++&&r   c                .    U R                   R                  $ )z:The Python codec name of the connection's client encoding.)r   	_encodingr   s    r   r>   ConnectionInfo.encoding   s     {{$$$r   c                d    [        U R                  U5      nUR                  U R                  5      $ r   )getattrr   rJ   r>   )r   namevalues      r   r!   ConnectionInfo._get_pgconn_attr   s%    t{{D1||DMM**r   r   N)r   zpq.abc.PGconn)returnrD   )rx   r*   )rx   zdict[str, str])rx   zpq.ConnStatus)rx   zpq.TransactionStatus)rx   zpq.PipelineStatus)ra   rD   rx   z
str | None)rx   r   )ru   rD   rx   rD   )__name__
__module____qualname____firstlineno____doc__r   propertyr   r   r%   r)   r2   r5   r8   r;   rN   rQ   rU   rY   r]   r`   re   rh   rk   rn   r>   r!   __static_attributes__r   r   r   r   r      sw   ;J   - - 1 1 C C + + - - 1 1 0 0
8 	6 	6 1 1 D D > >F * * ' ' 6 6 ' ' % %+r   r   N)r}   
__future__r   pathlibr   datetimer    r   r-   r   _tzr	   conninfor
   r   r   r   r   <module>r      s-    #      #e+ e+r   