§
    É$gQ  ã                  óh   — d 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 e¦   «         Z	d	S )
z
psycopg capabilities objects
é    )Úannotationsé   )Úpq)Ú_cmodule)ÚNotSupportedErrorc                  óx   — e Zd ZdZdd„Zddd„Zddd	„Zddd
„Zddd„Zddd„Z	ddd„Z
ddd„Zdd„Zdd„Zdd„ZdS )ÚCapabilitiesz\
    An object to check if a feature is supported by the libpq available on the client.
    ÚreturnÚNonec                ó   — i | _         d S )N)Ú_cache)Úselfs    úU/var/www/html/netbox-4.1.3/venv/lib/python3.11/site-packages/psycopg/_capabilities.pyÚ__init__zCapabilities.__init__   s   € Ø&(ˆŒˆˆó    FÚcheckÚboolc                ó2   — |                       dd|¬¦  «        S )z~Check if the `PGconn.encrypt_password()` method is implemented.

        The feature requires libpq 10.0 and greater.
        zpq.PGconn.encrypt_password()i † ©r   ©Ú_has_feature©r   r   s     r   Úhas_encrypt_passwordz!Capabilities.has_encrypt_password   ó    € ð
 × Ò Ð!?ÀÈuÐ ÑUÔUÐUr   c                ó2   — |                       dd|¬¦  «        S )zCheck 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_hostaddrzCapabilities.has_hostaddr   ó    € ð
 × Ò Ð!;¸VÈ5Ð ÑQÔQÐQr   c                ó2   — |                       dd|¬¦  «        S )z~Check 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_pipelinezCapabilities.has_pipeline$   s    € ð
 × Ò Ð!8¸&ÈÐ ÑNÔNÐNr   c                ó2   — |                       dd|¬¦  «        S )z€Check 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_flagsz Capabilities.has_set_trace_flags+   r   r   c                ó2   — |                       dd|¬¦  «        S )z}Check 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_safezCapabilities.has_cancel_safe2   r   r   c                ó2   — |                       dd|¬¦  «        S )z³Check 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_chunkedzCapabilities.has_stream_chunked9   s)   € ð × Ò ØBÀFÐRWð !ñ 
ô 
ð 	
r   c                ó2   — |                       dd|¬¦  «        S )z…Check 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_preparedz$Capabilities.has_send_close_preparedC   r   r   ÚfeatureÚstrÚwant_versionÚintc                óž   — || j         v r| j         |         }n |                      ||¦  «        }|| j         |<   |sdS |rt          |¦  «        ‚dS )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   r*   r,   r   Úmsgs        r   r   zCapabilities._has_featureJ   sh   € ð d”kÐ!Ð!Ø”+˜gÔ&ˆCˆCà×/Ò/°¸ÑFÔFˆCØ#&ˆDŒK˜Ñ àð 	Ø4Øð 	Ý# CÑ(Ô(Ð(à5r   c           
     óŽ  — t          j        ¦   «         |k     rVd|› d|                      ¦   «         › dt          j        t          j        ¦   «         ¦  «        › dt          j        |¦  «        › d	S t           j        |k     rGd|› dt           j        › dt          j        t           j        ¦  «        › dt          j        |¦  «        › d	S dS )	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   r*   r,   s      r   r/   z%Capabilities._get_unsupported_message`   s÷   € õ Œ:‰<Œ<˜,Ò&Ð&ð ð ð Ø<@×<NÒ<NÑ<PÔ<Pðð åÔ(­¬©¬Ñ6Ô6ðð õ ,.Ô+<¸\Ñ+JÔ+Jðð ð ðõ Ô! LÒ0Ð0ð? ð ?ð ?Ý,.¬Kð?ð ?å')Ô'8½Ô9MÑ'NÔ'Nð?ð ?õ Ô% lÑ3Ô3ð	?ð ?ð ?ðð 2r   c                óL   — t           j        dk    rt          j        pd}d|› S dS )z5Return a string reporting where the libpq comes from.ÚbinaryÚunknownz$the psycopg[binary] package version zsystem libraries)r   r7   r   Ú__version__)r   r3   s     r   r4   zCapabilities._libpq_sourcez   s0   € åŒ;˜(Ò"Ð"Ý#Ô/Ð<°9ˆGØC¸'ÐCÐCÐCà%Ð%r   N)r
   r   )F)r   r   r
   r   )r*   r+   r,   r-   r   r   r
   r   )r*   r+   r,   r-   r
   r+   )r
   r+   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r    r"   r%   r'   r)   r   r/   r4   © r   r   r	   r	      s;  € € € € € ðð ð)ð )ð )ð )ðVð Vð Vð Vð VðRð Rð Rð Rð RðOð Oð Oð Oð OðRð Rð Rð Rð RðRð Rð Rð Rð Rð
ð 
ð 
ð 
ð 
ðVð Vð Vð Vð Vðð ð ð ð,ð ð ð ð4&ð &ð &ð &ð &ð &r   r	   N)
r?   Ú
__future__r   r2   r   r   Úerrorsr   r	   Úcapabilitiesr@   r   r   ú<module>rD      s›   ððð ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %ðr&ð r&ð r&ð r&ð r&ñ r&ô r&ð r&ðl ˆ|‰~Œ~€€€r   