ó
    Ð]j  ã                  óR   • S r SSKJr  SSKJrJr  SSKJr   " S S5      r\" 5       r	g)	z
psycopg capabilities objects
é    )Úannotationsé   )Ú_cmoduleÚpq)Ú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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    ÚR/home/mande/repo/quber/.venv/lib/python3.13/site-packages/psycopg/_capabilities.pyÚ__init__ÚCapabilities.__init__   s	   € Ø&(ˆ�ó    c                ó$   • U R                  SSUS9$ )zÞCheck if the `PGconn.full_protocol_version()` method is implemented.

If the method is implemented, then `ConnectionInfo.full_protocol_version`
will return a meaningful value.

The feature requires libpq 18.0 and greater.
z!pq.PGconn.full_protocol_version()i ¿ ©Úcheck©Ú_has_feature©r   r   s     r   Úhas_full_protocol_versionÚ&Capabilities.has_full_protocol_version   s#   € ð × Ñ Ø/°¸uð !ð 
ð 	
r   c                ó$   • U R                  SSUS9$ )zmCheck if the `PGconn.encrypt_password()` method is implemented.

The feature requires libpq 10.0 or greater.
zpq.PGconn.encrypt_password()i † r   r   r   s     r   Úhas_encrypt_passwordÚ!Capabilities.has_encrypt_password!   ó   € ð
 × Ñ Ð!?ÀÈuÐ ÐUÐUr   c                ó$   • U R                  SSUS9$ )znCheck if the `ConnectionInfo.hostaddr` attribute is implemented.

The feature requires libpq 12.0 or greater.
zConnection.info.hostaddriÀÔ r   r   r   s     r   Úhas_hostaddrÚCapabilities.has_hostaddr(   ó   € ð
 × Ñ Ð!;¸VÈ5Ð ÐQÐQr   c                ó$   • U R                  SSUS9$ )zmCheck if the :ref:`pipeline mode <pipeline-mode>` is supported.

The feature requires libpq 14.0 or 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$ )zoCheck if the `pq.PGconn.set_trace_flags()` method is implemented.

The feature requires libpq 14.0 or greater.
zPGconn.set_trace_flags()r$   r   r   r   s     r   Úhas_set_trace_flagsÚ Capabilities.has_set_trace_flags6   r"   r   c                ó$   • U R                  SSUS9$ )zlCheck if the `pq.PGconn.used_gssapi` attribute is implemented.

The feature requires libpq 16.0 or greater.
zPGconn.used_gssapii q r   r   r   s     r   Úhas_used_gssapiÚCapabilities.has_used_gssapi=   s   € ð
 × Ñ Ð!5°vÀUÐ ÐKÐKr   c                ó$   • U R                  SSUS9$ )zlCheck if the `Connection.cancel_safe()` method is implemented.

The feature requires libpq 17.0 or greater.
zConnection.cancel_safe()é˜ r   r   r   s     r   Úhas_cancel_safeÚCapabilities.has_cancel_safeD   r"   r   c                ó$   • U R                  SSUS9$ )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 or greater.
z4Cursor.stream() with 'size' parameter greater than 1r.   r   r   r   s     r   Úhas_stream_chunkedÚCapabilities.has_stream_chunkedK   s$   € ð × Ñ ØBÀFÐRWð !ð 
ð 	
r   c                ó$   • U R                  SSUS9$ )ztCheck if the `pq.PGconn.send_closed_prepared()` method is implemented.

The feature requires libpq 17.0 or greater.
zPGconn.send_close_prepared()r.   r   r   r   s     r   Úhas_send_close_preparedÚ$Capabilities.has_send_close_preparedU   r   r   c                ó¶   •  U R                   U   nU(       d  gU(       a  [        U5      eg! [         a"    U R                  X5      nX@R                   U'    NFf = f)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   ÚKeyErrorÚ_get_unsupported_messager   )r   ÚfeatureÚwant_versionr   Úmsgs        r   r   ÚCapabilities._has_feature\   s[   € ð	'Ø—+‘+˜gÑ&ˆCö
 ØÞÜ# CÓ(Ð(àøô ó 	'Ø×/Ñ/°ÓFˆCØ#&�K‰K˜Ó ð	'ús   ‚, ¬)AÁA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   r:   r;   s      r   r9   Ú%Capabilities._get_unsupported_messager   sÖ   € ô �:Š:‹<˜,Ó&à ˜yð )<Ø<@×<NÑ<NÓ<PÐ;Qð RÜ×(Ò(¬¯ª«Ó6Ð7ð 8+Ü+-×+<Ò+<¸\Ó+JÐ*KØð	ðô ×!Ñ! LÓ0à ˜yð ),Ü,.¯K©K¨=ð 9'Ü')×'8Ò'8¼×9MÑ9MÓ'NÐ&Oð Pä×%Ò% lÓ3Ð4°Ið	?ðð 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   rD   r   Ú__version__)r   r@   s     r   rA   ÚCapabilities._libpq_sourceŒ   s.   € ä�;‰;˜(Ó"Ü#×/Ñ/×<°9ˆGØ9¸'¸ÐCÐCà%r   r   N)ÚreturnÚNone)F)r   ÚboolrK   rM   )r:   Ústrr;   Úintr   rM   rK   rM   )r:   rN   r;   rO   rK   rN   )rK   rN   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r    r%   r(   r+   r/   r2   r5   r   r9   rA   Ú__static_attributes__© r   r   r	   r	      sO   † ñô)ö

öVöRöOöRöLöRö
öVôô,÷4&r   r	   N)
rT   Ú
__future__r   r?   r   r   Úerrorsr   r	   ÚcapabilitiesrV   r   r   Ú<module>rZ      s+   ðñõ #ç Ý %÷E&ñ E&ñR ‹~�r   