
    fj,$                        S SK r S SKrS SKrSrS r " S S\5      r " S S\S9r " S	 S
\\5      r	 " S S\	5      r
 " S S\
5      r " S S5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\5      r " S S\5      r " S S\\5      r " S S\5      r " S S \5      r " S! S"\5      r " S# S$\5      r " S% S&\5      rg)'    N)PostgresErrorFatalPostgresErrorUnknownPostgresErrorInterfaceErrorInterfaceWarningPostgresLogMessageClientConfigurationErrorInternalClientErrorOutdatedSchemaCacheErrorProtocolErrorUnsupportedClientFeatureErrorTargetServerAttributeNotMatchedUnsupportedServerFeatureErrorc                 T    U R                   nUS:H  =(       d    UR                  S5      $ )Nasyncpgzasyncpg.)
__module__
startswith)clsmodnames     Q/var/www/html/GQ-WA/venv/lib/python3.13/site-packages/asyncpg/exceptions/_base.py_is_asyncpg_classr      s&    nnGiA7#5#5j#AA    c                      ^  \ rS rSr0 r0 SS_SS_SS_SS	_S
S_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_S S!_S"S#_S$S%0ErU 4S& jr\S' 5       rS(r	U =r
$ ))PostgresMessageMeta   SseverityVseverity_enCsqlstateMmessageDdetailHhintPpositionpinternal_positionqinternal_queryWcontextsschema_namet
table_nameccolumn_nameddata_type_namenconstraint_nameFserver_source_filenameLserver_source_lineRserver_source_functionc                 8  > [         T	U ]  XX#5      nUR                  U R                  :X  a3  US:X  a-  U R                  R	                  5        H  n[        XES 5        M     [        U5      (       aG  [        R                  UR                     n[        Xa5      (       a  [        SR                  U5      5      eUR                  S5      nUbP  U R                  R                  U5      nUb$  [        SR                  XR                  5      5      eX@R                  U'   U$ )NPostgresMessagez exception class redefinition: {}r!   z={} has duplicate SQLSTATE code, which isalready defined by {})super__new__r   
_field_mapvaluessetattrr   sysmoduleshasattrRuntimeErrorformatget_message_map	TypeError__name__)
mclsnamebasesdctr   fmodcodeexisting	__class__s
            r   rC   PostgresMessageMeta.__new__2   s    god%5>>T__,9J1J__++-% . S!!++cnn-Cs!!"#E#L#L$   wwz"((,,T2H# !88>$(*;*;9=> > '*d#
r   c                 B    U R                   R                  U[        5      $ N)rM   rL   r   )rP   rV   s     r   get_message_class_for_sqlstate2PostgresMessageMeta.get_message_class_for_sqlstateI   s      $$T+?@@r    )rO   r   __qualname____firstlineno__rM   rD   rC   classmethodr\   __static_attributes____classcell__rX   s   @r   r   r      s   LZ] 	Z 	Y	
 	X 	V 	Z 	  	 	Y 	] 	\ 	] 	 	  	%!" 	!#$ 	%%J*. A Ar   r   c                   N    \ rS rSr\S 5       r\S 5       r\SS j5       rS rSr	g)	rA   N   c                 X    UR                  S5      n[        U 5      R                  U5      $ )Nr    )rL   typer\   )r   fieldsr!   s      r   _get_error_class PostgresMessage._get_error_classP   s$    ::c?Cy77AAr   c                     SU0n[        U 5      R                  nUR                  5        H#  u  pVUR                  U5      nU(       d  M  XcU'   M%     U$ )Nquery)rh   rD   itemsrL   )r   ri   rm   rS   	field_mapkvfields           r   _get_error_dictPostgresMessage._get_error_dictU   sT     U
 I((	LLNDAMM!$EuE
 #
 
r   Nc                    U R                  X5      nU R                  U5      nUR                  SS5      nUR                  S:H  =(       a&    [	        U5      =(       a    UR                  S5      S:H  nU(       a+  [
        R                  UR                     nUR                  nSnUR                  S;   =(       a    [	        U5      nU(       a/  UR                  SS5      n	U	[        R                  " S	5      -  n	XS'   XEU4$ )
Nr#    FeatureNotSupportedErrorr?   RevalidateCachedQueryzQcached statement plan is invalid due to a database schema or configuration change)DuplicatePreparedStatementErrorInvalidSQLStatementNameErrorr'   a  
                NOTE: pgbouncer with pool_mode set to "transaction" or
                "statement" does not support prepared statements properly.
                You have two options:

                * if you are using pgbouncer for connection pooling to a
                  single server, switch to the connection pool functionality
                  provided by asyncpg, it is a much better option for this
                  purpose;

                * if you have no option of avoiding the use of pgbouncer,
                  then you can set statement_cache_size to 0 when creating
                  the asyncpg connection object.
            )rs   rj   rL   rO   r   rG   rH   r   InvalidCachedStatementErrortextwrapdedent)
r   ri   rm   rS   excclsr#   is_icse
exceptionsis_prepared_stmt_errorr'   s
             r   _make_constructor!PostgresMessage._make_constructorc   s   !!&0%%f-'')R( OO99 If%IGG,-1HH 	 V%6%67J;;F8G OO  @ @ &f% 	 "7762&DHOO %  D  K##r   c                     0 n[        U 5      R                  R                  5        H  n[        X5      nUc  M  X1U'   M     U$ r[   )rh   rD   rE   getattr)selfrS   rT   vals       r   as_dictPostgresMessage.as_dict   sA    d&&--/A$"CA 0 
r   r^   r[   )
rO   r   r_   r`   ra   rj   rs   r   r   rb   r^   r   r   rA   rA   N   sD    B B   6$ 6$pr   rA   )	metaclassc                   2    \ rS rSrSrS r\SS j5       rSrg)r      z#Base class for all Postgres errors.c                     U R                   S   nU R                  (       a  USR                  U R                  5      -  nU R                  (       a  USR                  U R                  5      -  nU$ Nr   z
DETAIL:  {}z

HINT:  {}argsr%   rK   r'   r   msgs     r   __str__PostgresError.__str__   T    iil;;?))$++66C99=''		22C
r   Nc                 t    U R                  X5      u  p4nU" U5      nUR                  R                  U5        U$ r[   )r   __dict__update)r   ri   rm   r~   r#   rS   exs          r   newPostgresError.new   s7    "44VCG_
3	r   r^   r[   )	rO   r   r_   r`   __doc__r   ra   r   rb   r^   r   r   r   r      s    -  r   r   c                       \ rS rSrSrSrg)r      z9A fatal error that should result in server disconnection.r^   NrO   r   r_   r`   r   rb   r^   r   r   r   r      s    Cr   r   c                       \ rS rSrSrSrg)r      z'An error with an unknown SQLSTATE code.r^   Nr   r^   r   r   r   r          1r   r   c                   *    \ rS rSrSSS.S jrS rSrg)InterfaceMessage   Nr%   r'   c                    Xl         X l        g r[   r   )r   r%   r'   s      r   __init__InterfaceMessage.__init__   s    	r   c                     U R                   S   nU R                  (       a  USR                  U R                  5      -  nU R                  (       a  USR                  U R                  5      -  nU$ r   r   r   s     r   r   InterfaceMessage.__str__   r   r   )rO   r   r_   r`   r   r   rb   r^   r   r   r   r      s    !%D r   r   c                   .    \ rS rSrSrSSS.S jrS rSrg)r      z/An error caused by improper use of asyncpg API.Nr   c                V    [         R                  XUS9  [        R                  X5        g Nr   )r   r   	Exceptionr   r   r%   r'   s       r   r   InterfaceError.__init__   s#    !!$D!A4%r   c                 ~    [        U 5      " UU R                  U R                  S9R                  U R                  5      $ r   )rh   r%   r'   with_traceback__traceback__r   s     r   with_msgInterfaceError.with_msg   s9    Dz;;
 .
		
r   r^   )rO   r   r_   r`   r   r   r   rb   r^   r   r   r   r      s    9&* &
r   r   c                       \ rS rSrSrSrg)r	      z1An error caused by improper client configuration.r^   Nr   r^   r   r   r	   r	      s    ;r   r	   c                       \ rS rSrSrSrg)	DataError   z'An error caused by invalid query input.r^   Nr   r^   r   r   r   r      r   r   r   c                       \ rS rSrSrSrg)r      z,Requested feature is unsupported by asyncpg.r^   Nr   r^   r   r   r   r      s    6r   r   c                       \ rS rSrSrSrg)r      z6Requested feature is unsupported by PostgreSQL server.r^   Nr   r^   r   r   r   r      s    @r   r   c                   (    \ rS rSrSrSSS.S jrSrg)r      z3A warning caused by an improper use of asyncpg API.Nr   c                V    [         R                  XUS9  [        R                  X5        g r   )r   r   UserWarningr   s       r   r   InterfaceWarning.__init__   s#    !!$D!AT'r   r^   )rO   r   r_   r`   r   r   rb   r^   r   r   r   r      s    =&* ( (r   r   c                       \ rS rSrSrSrg)r
      z/All unexpected errors not classified otherwise.r^   Nr   r^   r   r   r
   r
      s    9r   r
   c                       \ rS rSrSrSrg)r      zBUnexpected condition in the handling of PostgreSQL protocol input.r^   Nr   r^   r   r   r   r      s    Lr   r   c                       \ rS rSrSrSrg)r   i  zECould not find a host that satisfies the target attribute requirementr^   Nr   r^   r   r   r   r     s    Or   r   c                   8   ^  \ rS rSrSrSSSS.U 4S jjrSrU =r$ )r   i  zEA value decoding error caused by a schema change before row fetching.N)schema	data_typer)   c                H   > [         TU ]  U5        X l        X0l        X@l        g r[   )rB   r   r1   r7   r)   )r   r   r   r   r)   rX   s        r   r   !OutdatedSchemaCacheError.__init__  s!    !' r   )r7   r)   r1   )rO   r   r_   r`   r   r   rb   rc   rd   s   @r   r   r     s    O&*dT ! !r   r   c                   8    \ rS rSrSrS rS r\SS j5       rSr	g)	r   i  z+A base class for non-error server messages.c                 `    SR                  [        U 5      R                  U R                  5      $ )Nz{}: {})rK   rh   rO   r#   )r   s    r   r   PostgresLogMessage.__str__  s!    tDz22DLLAAr   c                 \    [        SR                  [        U 5      R                  5      5      e)Nzinstances of {} are immutable)rN   rK   rh   rO   )r   rQ   r   s      r   __setattr__PostgresLogMessage.__setattr__  s*    7>>J! " 	"r   Nc                    U R                  X5      u  p4nU[        L a  [        nU[        L aT  UR                  S5      =(       d    UR                  S5      nU(       a$  UR	                  5       S:X  a  [
        R                  n[        U[        [        45      (       a	  U" U5      nOU" 5       nUR                  R                  U5        U$ )Nr   r   WARNING)r   r   r   rL   upperr   PostgresWarning
issubclassBaseExceptionWarningr   r   )r   ri   rm   r~   message_textrS   r   r   s           r   r   PostgresLogMessage.new  s    $'$9$9&$H!c))'F''ww}-D1DHHNN,	9 00f}g677&C(CC 
r   r^   r[   )
rO   r   r_   r`   r   r   r   ra   r   rb   r^   r   r   r   r     s$    5B"  r   r   )r   rG   r|   __all__r   rh   r   rA   r   r   r   r   r   r   
ValueErrorr	   r   r   r   r   r   r
   r   r   r   r   r^   r   r   <module>r      s    
 ,B
1A$ 1AhT 3 TnOY (D D2- 2 
%y 
"<~z <2
 27N 7AN A(' (:) :M' MP&9 P!2 ! r   