
    (ph                    d    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
5      rg)z>
Objects to return information about a PostgreSQL connection.
    )annotations)Path)tzinfo   )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     K/var/www/html/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                6    [        U R                  S5      5      $ )z6The port of the active connection. See :pq:`PQport()`.port)intr    r   s    r   r(   ConnectionInfo.port(   s     4((011r   c                $    U R                  S5      $ )z6The database name of the connection. See :pq:`PQdb()`.dbr   r   s    r   dbnameConnectionInfo.dbname-   s     $$T**r   c                $    U R                  S5      $ )z4The user name of the connection. See :pq:`PQuser()`.userr   r   s    r   r0   ConnectionInfo.user2   r"   r   c                $    U R                  S5      $ )z3The password of the connection. See :pq:`PQpass()`.passwordr   r   s    r   r3   ConnectionInfo.password7   r&   r   c                $    U R                  S5      $ )zQ
The command-line options passed in the connection request.
See :pq:`PQoptions`.
optionsr   r   s    r   r6   ConnectionInfo.options<   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_parametersD   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	   rI   r   s    r   dsnConnectionInfo.dsn`   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   rP   ConnectionInfo.statusl   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   rT   !ConnectionInfo.transaction_statusq   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   rX   ConnectionInfo.pipeline_statusy   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_statusrA   r9   rE   )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   r`   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   rc   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   rf   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   r9   ConnectionInfo.encoding   s     {{$$$r   c                d    [        U R                  U5      nUR                  U R                  5      $ r   )getattrr   rE   r9   )r   namevalues      r   r    ConnectionInfo._get_pgconn_attr   s%    t{{D1||DMM**r   r   N)r   zpq.abc.PGconn)returnr?   )rs   r)   )rs   zdict[str, str])rs   zpq.ConnStatus)rs   zpq.TransactionStatus)rs   zpq.PipelineStatus)r\   r?   rs   z
str | None)rs   r   )rp   r?   rs   r?   )__name__
__module____qualname____firstlineno____doc__r   propertyr   r   r$   r(   r-   r0   r3   r6   rI   rL   rP   rT   rX   r[   r`   rc   rf   ri   r9   r    __static_attributes__r   r   r   r   r      su   ;J   - - 1 1 2 2 + + - - 1 1 0 0
8 	6 	6 1 1 D D > >F * * ' ' 6 6 ' ' % %+r   r   N)rx   
__future__r   pathlibr   datetimer    r   _tzr   conninfor	   r   r   r   r   <module>r      s*    #     #\+ \+r   