
    (phQ                    Z    S 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\" 5       r	g	)
z
psycopg capabilities objects
    )annotations   )pq)_cmodule)NotSupportedErrorc                      \ rS rSrSrSS jrSSS jjrSSS jjrSSS jjrSSS jjr	SSS jjr
SSS	 jjrSSS
 jjrSS jrSS jrSS jrSrg)Capabilities   zT
An object to check if a feature is supported by the libpq available on the client.
c                    0 U l         g )N_cache)selfs    H/var/www/html/venv/lib/python3.13/site-packages/psycopg/_capabilities.py__init__Capabilities.__init__   s	    &(    c                $    U R                  SSUS9$ )znCheck if the `PGconn.encrypt_password()` method is implemented.

The feature requires libpq 10.0 and greater.
zpq.PGconn.encrypt_password()i check_has_featurer   r   s     r   has_encrypt_password!Capabilities.has_encrypt_password       
   !?u UUr   c                $    U R                  SSUS9$ )zoCheck if the `ConnectionInfo.hostaddr` attribute is implemented.

The feature requires libpq 12.0 and greater.
zConnection.info.hostaddri r   r   r   s     r   has_hostaddrCapabilities.has_hostaddr       
   !;V5 QQr   c                $    U R                  SSUS9$ )znCheck if the :ref:`pipeline mode <pipeline-mode>` is supported.

The feature requires libpq 14.0 and greater.
zConnection.pipeline()" r   r   r   s     r   has_pipelineCapabilities.has_pipeline$   s    
   !8& NNr   c                $    U R                  SSUS9$ )zpCheck if the `pq.PGconn.set_trace_flags()` method is implemented.

The feature requires libpq 14.0 and greater.
zPGconn.set_trace_flags()r!   r   r   r   s     r   has_set_trace_flags Capabilities.has_set_trace_flags+   r   r   c                $    U R                  SSUS9$ )zmCheck if the `Connection.cancel_safe()` method is implemented.

The feature requires libpq 17.0 and greater.
zConnection.cancel_safe() r   r   r   s     r   has_cancel_safeCapabilities.has_cancel_safe2   r   r   c                $    U R                  SSUS9$ )zCheck if `Cursor.stream()` can handle a `size` parameter value
greater than 1 to retrieve results by chunks.

The feature requires libpq 17.0 and greater.
z4Cursor.stream() with 'size' parameter greater than 1r(   r   r   r   s     r   has_stream_chunkedCapabilities.has_stream_chunked9   s$       BFRW ! 
 	
r   c                $    U R                  SSUS9$ )zuCheck if the `pq.PGconn.send_closed_prepared()` method is implemented.

The feature requires libpq 17.0 and greater.
zPGconn.send_close_prepared()r(   r   r   r   s     r   has_send_close_prepared$Capabilities.has_send_close_preparedC   r   r   c                    XR                   ;   a  U R                   U   nOU R                  X5      nX@R                   U'   U(       d  gU(       a  [        U5      eg)z
Check is a version is supported.

If `check` is true, raise an exception with an explicative message
explaining why the feature is not supported.

The expletive messages, are left to the user.
TF)r   _get_unsupported_messager   )r   featurewant_versionr   msgs        r   r   Capabilities._has_featureJ   sO     kk!++g&C//FC#&KK #C((r   c           
        [         R                  " 5       U:  aX  SU SU R                  5        S[         R                  " [         R                  " 5       5       S[         R                  " U5       S3	$ [         R                  U:  aS  SU S[         R
                   S[         R                  " [         R                  5       S[         R                  " U5       S3	$ g)	z~
Return a descriptinve message to describe why a feature is unsupported.

Return an empty string if the feature is supported.
zthe feature 'z<' is not available: the client libpq version (imported from z) is z%; the feature requires libpq version z	 or newerz,' is not available: you are using a psycopg[z)] libpq wrapper built with libpq version  )r   version_libpq_sourceversion_pretty__build_version____impl__)r   r3   r4   s      r   r2   %Capabilities._get_unsupported_message`   s     ::<,&y )<<@<N<N<P;Q R((67 8++-+<+<\+J*K	 !!L0y ),,.KK= 9'')'8'89M9M'N&O P%%l34I	? r   c                h    [         R                  S:X  a  [        R                  =(       d    SnSU 3$ g)z5Return a string reporting where the libpq comes from.binaryunknownz$the psycopg[binary] package version zsystem libraries)r   r=   r   __version__)r   r9   s     r   r:   Capabilities._libpq_sourcez   s.    ;;("#//<9G9'CC%r   r   N)returnNone)F)r   boolrD   rF   )r3   strr4   intr   rF   rD   rF   )r3   rG   r4   rH   rD   rG   )rD   rG   )__name__
__module____qualname____firstlineno____doc__r   r   r   r"   r%   r)   r,   r/   r   r2   r:   __static_attributes__ r   r   r	   r	      sD    )VRORR
V,4&r   r	   N)
rM   
__future__r   r8   r   r   errorsr   r	   capabilitiesrO   r   r   <module>rS      s.    #   %r& r&l ~r   