ó
    Ð]j  ã                  ó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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     ÚU/home/mande/repo/quber/.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Ð0ˆ4Õ0Ü�t“9Ðô
 —W‘W×.Ñ.Ó0Ð0ˆTÕ0Ü�t“9Ðä�oŠoÐ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  € ð —‘ˆô
 —[‘[×-Ñ-Ô/ó
â/�Ø�z‰zó "ˆA�I‰I�q—z‘zÒ!Ù/ð 	ð 
ð 	×ÑÐ.°	Ô:Ü #¤D§I¢I£K°)Ñ$;Ó <× CÑ CÓ Eˆ�Ñð —[‘[×%Ò%ó
â%�Ø�u‰uó 9ð —	‘	˜[Ñ(ó 9ð —‘˜Ÿ™ a§i¡iÓ0Ñ0ó	 9ˆA�I‰I×Ñ˜UÓ# Q§U¡U§\¡\°%Ó%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   € ô Ñ5˜t×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   € ô ×#Ò# D§K¡K×$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   € ð �k‰k×*Ñ*¨:×+<Ñ+<¸T¿]¹]Ó+KÓLˆØ,/©Oˆs�z‰z˜$Ÿ-™-Ó(Ð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                  $ ! [        R                   a    U R                   R                  S-  s $ f = f)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   rh   Ú$ConnectionInfo.full_protocol_version›   sA   € ð	8Ø—;‘;×4Ñ4Ð4øÜ×"Ñ"ó 	8Ø—;‘;×/Ñ/°%Ñ7Ò7ð	8ús   ‚ ˜-AÁAc                ó.   • U R                   R                  $ )za
The process ID (PID) of the backend process handling this connection.
See :pq:`PQbackendPID()`.
)r   Úbackend_pidr   s    r   rm   Ú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   rp   Ú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ˆØ�|‰|˜DŸM™MÓ*Ð*r   r   N)r   zpq.abc.PGconn)ÚreturnrD   )r}   r*   )r}   zdict[str, str])r}   zpq.ConnStatus)r}   zpq.TransactionStatus)r}   zpq.PipelineStatus)ra   rD   r}   z
str | None)r}   r   )rz   rD   r}   rD   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úpropertyr   r   r%   r)   r2   r5   r8   r;   rN   rQ   rU   rY   r]   r`   re   rh   rm   rp   rs   r>   r!   Ú__static_attributes__r   r   r   r   r      s‹  † Ù;à€Jôð óó ðð ó-ó ð-ð ó1ó ð1ð óCó ðCð ó+ó ð+ð ó-ó ð-ð ó1ó ð1ð ó0ó ð0ô
ð8 ó	6ó ð	6ð ó1ó ð1ð óDó ðDð ó>ó ð>ôFð ó*ó ð*ð ó8ó ð8ð" ó'ó ð'ð ó6ó ð6ð ó'ó ð'ð ó%ó ð%÷+r   r   N)r‚   Ú
__future__r   Úpathlibr   Údatetimer   Ú r   r-   r   Ú_tzr	   Úconninfor
   r   r   r   r   Ú<module>r‹      s-   ðñõ #å Ý å Ý Ý Ý #÷w+ò w+r   