o
    "4g                     @  s   U d Z ddlmZ ddlmZmZmZmZmZ ddlm	Z	 ddl
mZmZ ddlmZmZ er9dd	lmZmZmZ e	eeef Zd
ed< G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )zP
Protocol objects to represent objects exposed by different pq implementations.
    )annotations)AnyCallableProtocolSequenceTYPE_CHECKING)Union   )FormatTrace   )Self	TypeAlias)PGnotifyConninfoOptionPGresAttDescr   Bufferc                   @  sr  e Zd ZU ded< ded< edd	d
ZedddZdddZdddZe	dddZ
dddZdddZdddZedddZe	dddZe	dd d!Ze	dd"d#Ze	dd$d%Ze	dd&d'Ze	dd(d)Ze	dd*d+Ze	dd,d-Ze	dd.d/Ze	dd0d1Zdd4d5Ze	dd6d7Zddd;d<Ze	dd=d>Ze	dd?d@Ze	ddAdBZe	ddCdDZe	ddFdGZ e	ddHdIZ!e	ddJdKZ"ddNdOZ#ddPdQZ$dRdRe%j&fddYdZZ'dRdRe%j&fdd[d\Z(	Rddd]d^Z)dRe%j&fdd_d`Z*	RdddadbZ+	R	cdddedfZ,ddgdhZ-ddidjZ.ddkdlZ/ddmdnZ0ddodpZ1ddqdrZ2ddsdtZ3ddudvZ4ddxdyZ5ddzd{Z6dd|d}Z7e	dd~dZ8e8j9dddZ8dddZ:dddZ;dddZ<dddZ=dddZ>dddZ?dddZ@ddddZAdddZBdddZCdddZDdddZE	RddddZFdddZGdddZHe	dddZIdddZJdddZKdddZLdddZMdRS )PGconnz!Callable[[PGresult], None] | Nonenotice_handlerz!Callable[[PGnotify], None] | Nonenotify_handlerconninfobytesreturnr   c                 C     d S N clsr   r   r   W/var/www/html/authentication-server/venv/lib/python3.10/site-packages/psycopg/pq/abc.pyconnect      zPGconn.connectc                 C  r   r   r   r   r   r   r   connect_start   r    zPGconn.connect_startintc                 C  r   r   r   selfr   r   r   connect_poll        zPGconn.connect_pollNonec                 C  r   r   r   r#   r   r   r   finish"   r&   zPGconn.finishlist[ConninfoOption]c                 C  r   r   r   r#   r   r   r   info$   r    zPGconn.infoc                 C  r   r   r   r#   r   r   r   reset'   r&   zPGconn.resetc                 C  r   r   r   r#   r   r   r   reset_start)   r&   zPGconn.reset_startc                 C  r   r   r   r#   r   r   r   
reset_poll+   r&   zPGconn.reset_pollc                 C  r   r   r   )r$   r   r   r   r   ping-   r    zPGconn.pingc                 C  r   r   r   r#   r   r   r   db0   r    z	PGconn.dbc                 C  r   r   r   r#   r   r   r   user3   r    zPGconn.userc                 C  r   r   r   r#   r   r   r   password6   r    zPGconn.passwordc                 C  r   r   r   r#   r   r   r   host9   r    zPGconn.hostc                 C  r   r   r   r#   r   r   r   hostaddr<   r    zPGconn.hostaddrc                 C  r   r   r   r#   r   r   r   port?   r    zPGconn.portc                 C  r   r   r   r#   r   r   r   ttyB   r    z
PGconn.ttyc                 C  r   r   r   r#   r   r   r   optionsE   r    zPGconn.optionsc                 C  r   r   r   r#   r   r   r   statusH   r    zPGconn.statusc                 C  r   r   r   r#   r   r   r   transaction_statusK   r    zPGconn.transaction_statusnamebytes | Nonec                 C  r   r   r   r$   r9   r   r   r   parameter_statusN   r&   zPGconn.parameter_statusc                 C  r   r   r   r#   r   r   r   error_messageP   r    zPGconn.error_message.encodingstrc                 C  r   r   r   r$   r>   r   r   r   get_error_messageS   r&   zPGconn.get_error_messagec                 C  r   r   r   r#   r   r   r   	_encodingU   r    zPGconn._encodingc                 C  r   r   r   r#   r   r   r   server_versionX   r    zPGconn.server_versionc                 C  r   r   r   r#   r   r   r   socket[   r    zPGconn.socketc                 C  r   r   r   r#   r   r   r   backend_pid^   r    zPGconn.backend_pidboolc                 C  r   r   r   r#   r   r   r   needs_passworda   r    zPGconn.needs_passwordc                 C  r   r   r   r#   r   r   r   used_passwordd   r    zPGconn.used_passwordc                 C  r   r   r   r#   r   r   r   
ssl_in_useg   r    zPGconn.ssl_in_usecommandPGresultc                 C  r   r   r   r$   rJ   r   r   r   exec_j   r&   zPGconn.exec_c                 C  r   r   r   rL   r   r   r   
send_queryl   r&   zPGconn.send_queryNparam_valuesSequence[Buffer | None] | Noneparam_typesSequence[int] | Noneparam_formatsresult_formatc                 C  r   r   r   r$   rJ   rO   rQ   rS   rT   r   r   r   exec_paramsn      zPGconn.exec_paramsc                 C  r   r   r   rU   r   r   r   send_query_paramsw   rW   zPGconn.send_query_paramsc                 C  r   r   r   r$   r9   rJ   rQ   r   r   r   send_prepare      zPGconn.send_preparec                 C  r   r   r   r$   r9   rO   rS   rT   r   r   r   send_query_prepared      zPGconn.send_query_preparedc                 C  r   r   r   rY   r   r   r   prepare   r[   zPGconn.preparer   Sequence[Buffer] | Nonec                 C  r   r   r   r\   r   r   r   exec_prepared   r^   zPGconn.exec_preparedc                 C  r   r   r   r;   r   r   r   describe_prepared   r&   zPGconn.describe_preparedc                 C  r   r   r   r;   r   r   r   send_describe_prepared   r&   zPGconn.send_describe_preparedc                 C  r   r   r   r;   r   r   r   describe_portal   r&   zPGconn.describe_portalc                 C  r   r   r   r;   r   r   r   send_describe_portal   r&   zPGconn.send_describe_portalc                 C  r   r   r   r;   r   r   r   close_prepared   r&   zPGconn.close_preparedc                 C  r   r   r   r;   r   r   r   send_close_prepared   r&   zPGconn.send_close_preparedc                 C  r   r   r   r;   r   r   r   close_portal   r&   zPGconn.close_portalc                 C  r   r   r   r;   r   r   r   send_close_portal   r&   zPGconn.send_close_portalPGresult | Nonec                 C  r   r   r   r#   r   r   r   
get_result   r&   zPGconn.get_resultc                 C  r   r   r   r#   r   r   r   consume_input   r&   zPGconn.consume_inputc                 C  r   r   r   r#   r   r   r   is_busy   r&   zPGconn.is_busyc                 C  r   r   r   r#   r   r   r   nonblocking   r    zPGconn.nonblockingargc                 C  r   r   r   )r$   ro   r   r   r   rn      r    c                 C  r   r   r   r#   r   r   r   flush   r&   zPGconn.flushc                 C  r   r   r   r#   r   r   r   set_single_row_mode   r&   zPGconn.set_single_row_modesizec                 C  r   r   r   )r$   rr   r   r   r   set_chunked_rows_mode   r&   zPGconn.set_chunked_rows_modePGcancelConnc                 C  r   r   r   r#   r   r   r   cancel_conn   r&   zPGconn.cancel_connPGcancelc                 C  r   r   r   r#   r   r   r   
get_cancel   r&   zPGconn.get_cancelPGnotify | Nonec                 C  r   r   r   r#   r   r   r   notifies   r&   zPGconn.notifiesbufferr   c                 C  r   r   r   )r$   rz   r   r   r   put_copy_data   r&   zPGconn.put_copy_dataerrorc                 C  r   r   r   )r$   r|   r   r   r   put_copy_end   r&   zPGconn.put_copy_endasync_tuple[int, memoryview]c                 C  r   r   r   )r$   r~   r   r   r   get_copy_data   r&   zPGconn.get_copy_datafilenoc                 C  r   r   r   )r$   r   r   r   r   trace   r&   zPGconn.traceflagsr   c                 C  r   r   r   )r$   r   r   r   r   set_trace_flags   r&   zPGconn.set_trace_flagsc                 C  r   r   r   r#   r   r   r   untrace   r&   zPGconn.untracepasswdr0   	algorithmc                 C  r   r   r   )r$   r   r0   r   r   r   r   encrypt_password   s   zPGconn.encrypt_passwordc                 C  r   r   r   )r$   r0   r   r   r   r   change_password   r&   zPGconn.change_passwordexec_statusc                 C  r   r   r   )r$   r   r   r   r   make_empty_result   r&   zPGconn.make_empty_resultc                 C  r   r   r   r#   r   r   r   pipeline_status   r    zPGconn.pipeline_statusc                 C  r   r   r   r#   r   r   r   enter_pipeline_mode   r&   zPGconn.enter_pipeline_modec                 C  r   r   r   r#   r   r   r   exit_pipeline_mode   r&   zPGconn.exit_pipeline_modec                 C  r   r   r   r#   r   r   r   pipeline_sync   r&   zPGconn.pipeline_syncc                 C  r   r   r   r#   r   r   r   send_flush_request   r&   zPGconn.send_flush_request)r   r   r   r   r   r"   r   r'   r   r)   )r   r   r   r"   r   r   )r9   r   r   r:   .r>   r?   r   r?   )r   r?   )r   rF   )rJ   r   r   rK   )rJ   r   r   r'   )rJ   r   rO   rP   rQ   rR   rS   rR   rT   r"   r   rK   )rJ   r   rO   rP   rQ   rR   rS   rR   rT   r"   r   r'   r   )r9   r   rJ   r   rQ   rR   r   r'   )
r9   r   rO   rP   rS   rR   rT   r"   r   r'   )r9   r   rJ   r   rQ   rR   r   rK   )Nr   )
r9   r   rO   r`   rS   rR   rT   r"   r   rK   )r9   r   r   rK   )r9   r   r   r'   )r   rj   )ro   r"   r   r'   )rr   r"   r   r'   )r   rt   )r   rv   )r   rx   )rz   r   r   r"   )r|   r:   r   r"   )r~   r"   r   r   )r   r"   r   r'   )r   r   r   r'   )r   r   r0   r   r   r:   r   r   )r0   r   r   r   r   r'   )r   r"   r   rK   )N__name__
__module____qualname____annotations__classmethodr   r!   r%   r(   propertyr*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r<   r=   rA   rB   rC   rD   rE   rG   rH   rI   rM   rN   r
   TEXTrV   rX   rZ   r]   r_   ra   rb   rc   rd   re   rf   rg   rh   ri   rk   rl   rm   rn   setterrp   rq   rs   ru   rw   ry   r{   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s   
 


































r   c                   @  s  e Zd Zd=ddZed>ddZed?d	d
Zd@dAddZdBddZed>ddZ	ed>ddZ
dCddZdDddZdDddZdDdd ZdDd!d"ZdDd#d$ZdDd%d&Zed>d'd(ZdEd*d+Zed>d,d-ZdFd/d0ZedGd1d2ZedHd4d5Zed>d6d7ZdId:d;Zd<S )JrK   r   r'   c                 C  r   r   r   r#   r   r   r   clear   r&   zPGresult.clearr"   c                 C  r   r   r   r#   r   r   r   r7      r    zPGresult.statusr   c                 C  r   r   r   r#   r   r   r   r=      r    zPGresult.error_message.r>   r?   c                 C  r   r   r   r@   r   r   r   rA      r&   zPGresult.get_error_message	fieldcoder:   c                 C  r   r   r   )r$   r   r   r   r   error_field   r&   zPGresult.error_fieldc                 C  r   r   r   r#   r   r   r   ntuples   r    zPGresult.ntuplesc                 C  r   r   r   r#   r   r   r   nfields   r    zPGresult.nfieldscolumn_numberc                 C  r   r   r   r$   r   r   r   r   fname   r&   zPGresult.fnamec                 C  r   r   r   r   r   r   r   ftable   r&   zPGresult.ftablec                 C  r   r   r   r   r   r   r   	ftablecol   r&   zPGresult.ftablecolc                 C  r   r   r   r   r   r   r   fformat   r&   zPGresult.fformatc                 C  r   r   r   r   r   r   r   ftype  r&   zPGresult.ftypec                 C  r   r   r   r   r   r   r   fmod  r&   zPGresult.fmodc                 C  r   r   r   r   r   r   r   fsize  r&   zPGresult.fsizec                 C  r   r   r   r#   r   r   r   binary_tuples  r    zPGresult.binary_tuples
row_numberc                 C  r   r   r   )r$   r   r   r   r   r   	get_value
  r&   zPGresult.get_valuec                 C  r   r   r   r#   r   r   r   nparams  r    zPGresult.nparamsparam_numberc                 C  r   r   r   )r$   r   r   r   r   
param_type  r&   zPGresult.param_typec                 C  r   r   r   r#   r   r   r   command_status  r    zPGresult.command_status
int | Nonec                 C  r   r   r   r#   r   r   r   command_tuples  r    zPGresult.command_tuplesc                 C  r   r   r   r#   r   r   r   	oid_value  r    zPGresult.oid_valuedescriptionslist[PGresAttDesc]c                 C  r   r   r   )r$   r   r   r   r   set_attributes  r&   zPGresult.set_attributesNr   r   r   r   r   )r   r"   r   r:   )r   r"   r   r:   )r   r"   r   r"   )r   r"   r   r"   r   r:   )r   r"   r   r"   )r   r:   )r   r   )r   r   r   r'   )r   r   r   r   r   r7   r=   rA   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rK      s@    










rK   c                   @  st   e Zd ZdddZdddZddd	Zedd
dZedddZedddZ	ddddZ
dddZdddZdS ) rt   r   r'   c                 C  r   r   r   r#   r   r   r   start  r&   zPGcancelConn.startc                 C  r   r   r   r#   r   r   r   blocking   r&   zPGcancelConn.blockingr"   c                 C  r   r   r   r#   r   r   r   poll"  r&   zPGcancelConn.pollc                 C  r   r   r   r#   r   r   r   r7   $  r    zPGcancelConn.statusc                 C  r   r   r   r#   r   r   r   rD   '  r    zPGcancelConn.socketr   c                 C  r   r   r   r#   r   r   r   r=   *  r    zPGcancelConn.error_message.r>   r?   c                 C  r   r   r   r@   r   r   r   rA   -  r&   zPGcancelConn.get_error_messagec                 C  r   r   r   r#   r   r   r   r+   /  r&   zPGcancelConn.resetc                 C  r   r   r   r#   r   r   r   r(   1  r&   zPGcancelConn.finishNr   r   r   r   r   )r   r   r   r   r   r   r   r7   rD   r=   rA   r+   r(   r   r   r   r   rt     s    



rt   c                   @  s    e Zd ZdddZdddZdS )	rv   r   r'   c                 C  r   r   r   r#   r   r   r   free5  r&   zPGcancel.freec                 C  r   r   r   r#   r   r   r   cancel7  r&   zPGcancel.cancelNr   )r   r   r   r   r   r   r   r   r   rv   4  s    
rv   c                   @  s6   e Zd ZedddZedddZedddZdS )Conninfor   r)   c                 C  r   r   r   )r   r   r   r   get_defaults;  r    zConninfo.get_defaultsr   r   c                 C  r   r   r   r   r   r   r   parse>  r    zConninfo.parseoptsSequence[Any]c                 C  r   r   r   )r   r   r   r   r   _options_from_arrayA  r    zConninfo._options_from_arrayNr   )r   r   r   r)   )r   r   r   r)   )r   r   r   r   r   r   r   r   r   r   r   r   :  s    r   c                   @  sJ   e Zd Zd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S )EscapingNconnPGconn | Nonec                 C  r   r   r   )r$   r   r   r   r   __init__F  r&   zEscaping.__init__datar   r   r   c                 C  r   r   r   r$   r   r   r   r   escape_literalH  r&   zEscaping.escape_literalc                 C  r   r   r   r   r   r   r   escape_identifierJ  r&   zEscaping.escape_identifierc                 C  r   r   r   r   r   r   r   escape_stringL  r&   zEscaping.escape_stringc                 C  r   r   r   r   r   r   r   escape_byteaN  r&   zEscaping.escape_byteac                 C  r   r   r   r   r   r   r   unescape_byteaP  r&   zEscaping.unescape_bytear   )r   r   )r   r   r   r   )	r   r   r   r   r   r   r   r   r   r   r   r   r   r   E  s    



r   N)__doc__
__future__r   typingr   r   r   r   r   r   _enumsr
   r   _compatr   r   miscr   r   r   r   	bytearray
memoryviewr   r   r   rK   rt   rv   r   r   r   r   r   r   <module>   s      Q7