Ë
    r™ãjC*  ã                  ó<  — d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ ddlm	Z	 d	d
l
mZ d	dl
mZ d	dl
mZ d	dlmZ d	dlmZ d	dlmZ d	dlmZ d	dlmZ d	dlmZ d	dlmZ d	dlmZ d	dlmZ d	dlmZ d	dl m!Z! d	dl m"Z" d	dl m#Z# er6ddl$m%Z% ddl&m'Z' ddl&m(Z( d	dlm)Z) d	dl*m+Z+ d	dlm,Z, d	d lm-Z- d	d!lm.Z/ d	d"l0m1Z1  G d#„ d$e"e!   «      Z2 G d%„ d&e«      Z3 G d'„ d(ejh                  «      Z5 G d)„ d*e«      Z6 G d+„ d,e«      Z7 G d-„ d.e«      Z8 G d/„ d0e«      Z9y1)2é    )Úannotations)ÚAny)Úcast)ÚOptional)ÚType)ÚTYPE_CHECKINGé   )ÚRESERVED_WORDS_MARIADBé   )Úexc)Úschema)Úutil)Úcursor)Údefault)ÚDefaultDialect)ÚTypeCompiler)Úelements)Úsqltypes)ÚDDLCompiler)ÚIdentifierPreparer)ÚSQLCompiler)ÚSchemaConst)Ú_UUID_RETURN)ÚUUID)ÚUuid)ÚMySQLIdentifierPreparer)ÚINET4)ÚINET6)ÚURL)Ú
Connection)Úddl)ÚIdentityOptions)ÚSequence)Ú_BindProcessorTypec                  ó<   ‡ — e Zd Zddd„Zedd„«       Zdˆ fd„Zˆ xZS )Ú_MariaDBUUIDc                ó(   — || _         |sJ ‚d| _        y )NF)Úas_uuidÚnative_uuid)Úselfr(   r)   s      úr/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/_mariadb_shim.pyÚ__init__z_MariaDBUUID.__init__/   s   € ØˆŒñ
 Ðˆ{ð !ˆÕó    c                 ó   — y)NT© ©r*   s    r+   Únativez_MariaDBUUID.native;   s   € ð r-   c                óT   •— |j                   r|j                  st        ‰| �  |«      S y ©N)Úsupports_native_uuidÚ_allows_uuid_bindsÚsuperÚbind_processor)r*   ÚdialectÚ	__class__s     €r+   r7   z_MariaDBUUID.bind_processorA   s'   ø€ Ø×+Ò+°7×3MÒ3MÜ‘7Ñ)¨'Ó2Ð2àr-   )TT)r(   Úboolr)   r:   ©Úreturnr:   )r8   ÚMariaDBShimr<   z*Optional[_BindProcessorType[_UUID_RETURN]])Ú__name__Ú
__module__Ú__qualname__r,   Úpropertyr1   r7   Ú__classcell__©r9   s   @r+   r&   r&   .   s&   ø„ ô
!ð òó ð÷
ñ r-   r&   c                  ó   — e Zd Zdd„Zdd„Zy)ÚMariaDBTypeCompilerShimc                 ó   — y)Nr   r/   ©r*   Útype_Úkwargss      r+   Úvisit_INET4z#MariaDBTypeCompilerShim.visit_INET4I   ó   € Ør-   c                 ó   — y)Nr   r/   rG   s      r+   Úvisit_INET6z#MariaDBTypeCompilerShim.visit_INET6L   rK   r-   N)rH   r   rI   r   r<   Ústr)rH   r   rI   r   r<   rN   )r>   r?   r@   rJ   rM   r/   r-   r+   rE   rE   H   s   „ óôr-   rE   c                  ó(   — e Zd Zdd„Z	 	 	 	 	 	 dd„Zy)ÚMariadbExecutionContextShimc                ód  — | j                   rŸt        t        | j                  «      j                  rz| j
                  j                  sct        j                  | j
                  t        t        | j                  «      j                  D �cg c]  }|j                  d f‘Œ c}g «      | _        y y y y c c}w r3   )Úisdeleter   r   ÚcompiledÚeffective_returningr   ÚdescriptionÚ_cursorÚ FullyBufferedCursorFetchStrategyÚ_result_columnsÚkeynameÚcursor_fetch_strategy)r*   Úentrys     r+   Ú	post_execz%MariadbExecutionContextShim.post_execQ   s—   € à�MŠMÜ”[ $§-¡-Ó0×DÒDØ—K‘K×+Ò+ô ×8Ñ8Ø—K‘Kô &*Ü'¨¯©ó&ç)™/ö	à!ð Ÿ™¨Ò-òð ó	ð Õ&ð ,ð Eð ùòs   ÂB-
c                ó^   — | j                  d| j                  j                  |«      z  |«      S )Nzselect nextval(%s))Ú_execute_scalarÚidentifier_preparerÚformat_sequence)r*   ÚseqrH   s      r+   Úfire_sequencez)MariadbExecutionContextShim.fire_sequencek   s9   € ð ×#Ñ#à$Ø×*Ñ*×:Ñ:¸3Ó?ñ@ð ó
ð 	
r-   N©r<   ÚNone)ra   ÚSequence_SchemaItemrH   zsqltypes.Integerr<   Úint)r>   r?   r@   r\   rb   r/   r-   r+   rP   rP   P   s$   „ óð4	
Ø&ð	
Ø/?ð	
à	ô	
r-   rP   c                  ó   — e Zd Zdd„Zy)ÚMariaDBIdentifierPreparerShimc                ó   — t         | _        y r3   )r
   Úreserved_wordsr0   s    r+   Ú_set_mariadbz*MariaDBIdentifierPreparerShim._set_mariadbx   s
   € Ü4ˆÕr-   Nrc   )r>   r?   r@   rk   r/   r-   r+   rh   rh   w   s   „ ô5r-   rh   c                  ót   — e Zd Zdd„Z	 	 	 	 	 	 	 	 dd„Z	 	 	 	 	 	 	 	 	 	 d	d„Z	 	 	 	 	 	 	 	 d
d„Z	 	 	 	 	 	 dd„Zy)ÚMariaDBSQLCompilerShimc                ó>   — d| j                   j                  |«      z  S )Nznextval(%s))Úpreparerr`   )r*   ÚsequenceÚkws      r+   Úvisit_sequencez%MariaDBSQLCompilerShim.visit_sequence}   s   € Ø˜tŸ}™}×<Ñ<¸XÓFÑFÐFr-   c                ór   — d| j                  |t        j                  «      ›d | j                  |fi |¤Ž›d�S )NzCONCAT('(?', z, ')', ú))Úrender_literal_valuer   Ú
STRINGTYPEÚprocess)r*   ÚflagsÚpatternrq   s       r+   Ú_mariadb_regexp_flagsz,MariaDBSQLCompilerShim._mariadb_regexp_flags€   s7   � ð ×%Ñ% e¬X×-@Ñ-@ÕAØˆD�L‰L˜Ñ' BÓ'ð
ð 	
r-   c                óš   — |j                   d   } | j                  |j                  fi |¤Ž›|›| j                  ||j                  «      ›�S )Nrx   )Ú	modifiersrw   Úleftrz   Úright)r*   Ú	op_stringÚbinaryÚoperatorrq   rx   s         r+   Ú_mariadb_regexp_matchz,MariaDBSQLCompilerShim._mariadb_regexp_matchˆ   sL   € ð × Ñ  Ñ)ˆàˆD�L‰L˜Ÿ™Ñ+¨Ò+ÙØ×&Ñ& u¨f¯l©lÔ;ð
ð 	
r-   c           
     ó  — |j                   d   }d | j                  |j                  fi |¤Ž›d| j                  ||j                  j
                  d   «      ›d | j                  |j                  j
                  d   fi |¤Ž›d�S )Nrx   zREGEXP_REPLACE(z, r   r	   rt   )r|   rw   r}   rz   r~   Úclauses)r*   r€   r�   rq   rx   s        r+   Ú!_mariadb_regexp_replace_op_binaryz8MariaDBSQLCompilerShim._mariadb_regexp_replace_op_binary–   sv   € ð × Ñ  Ñ)‰àˆD�L‰L˜Ÿ™Ñ+¨Ó+Ø×&Ñ& u¨f¯l©l×.BÑ.BÀ1Ñ.EÕFØˆD�L‰L˜Ÿ™×-Ñ-¨aÑ0Ñ7°BÓ7ð
ð 	
r-   c                ó®   — |j                   }d}| j                  j                  |«      }d| j                  j                  |j                  «      ›d|›|›�S ©NzCONSTRAINT zALTER TABLE z DROP ©Úelementro   Úformat_constraintÚformat_tableÚtable©r*   Údroprq   Ú
constraintÚqualÚconsts         r+   Ú$_mariadb_visit_drop_check_constraintz;MariaDBSQLCompilerShim._mariadb_visit_drop_check_constraint    óN   € ð —\‘\ˆ
ØˆØ—‘×/Ñ/°
Ó;‰à�M‰M×&Ñ& z×'7Ñ'7Õ8ÙÙð
ð 	
r-   N)rp   zsa_schema.Sequencerq   r   r<   rN   )rx   rN   ry   zelements.ColumnElement[Any]rq   r   r<   rN   )
r   rN   r€   úelements.BinaryExpression[Any]r�   r   rq   r   r<   rN   )r€   r”   r�   r   rq   r   r<   rN   ©rŽ   zddl.DropConstraintrq   r   r<   rN   )r>   r?   r@   rr   rz   r‚   r…   r’   r/   r-   r+   rm   rm   |   s¤   „ óGð
Øð
Ø#>ð
ØFIð
à	ó
ð
àð
ð /ð
ð ð	
ð
 ð
ð 
ó
ð
Ø4ð
Ø@Cð
ØKNð
à	ó
ð

Ø&ð

Ø.1ð

à	ô

r-   rm   c                  óp   ‡ — e Zd ZU ded<   	 	 	 	 	 	 d	d„Zddœ	 	 	 	 	 	 	 d
d„Zdˆ fd„Z	 	 	 	 	 	 dd„Zˆ xZS )ÚMariaDBDDLCompilerShimr=   r8   c                ó‚   — |j                   �!|j                  t        j                  u rd|d<    | j                  |fi |¤ŽS )NTÚ_force_column_to_nullable)ÚcomputedÚ_user_defined_nullabler   ÚNULL_UNSPECIFIEDÚ_mysql_get_column_specification)r*   Úcolumnrq   s      r+   Ú!_mariadb_get_column_specificationz8MariaDBDDLCompilerShim._mariadb_get_column_specification°   sE   € ð
 �O‰OÐ'Ø×-Ñ-´×1MÑ1MÑMà.2ˆBÐ*Ñ+à3ˆt×3Ñ3°FÑA¸bÑAÐAr-   F)r™   c               ó   — t        «       ‚r3   )ÚNotImplementedError)r*   rž   r™   rq   s       r+   r�   z6MariaDBDDLCompilerShim._mysql_get_column_specification¼   s   € ô "Ó#Ð#r-   c                óJ   •— t         ‰| �  |«      }|j                  dd«      }|S )NzNO CYCLEÚNOCYCLE)r6   Úget_identity_optionsÚreplace)r*   Úidentity_optionsÚtextr9   s      €r+   r¤   z+MariaDBDDLCompilerShim.get_identity_optionsÅ   s(   ø€ Ü‰wÑ+Ð,<Ó=ˆØ�|‰|˜J¨	Ó2ˆØˆr-   c                ó®   — |j                   }d}| j                  j                  |«      }d| j                  j                  |j                  «      ›d|›|›�S r‡   rˆ   r�   s         r+   r’   z;MariaDBDDLCompilerShim._mariadb_visit_drop_check_constraintÊ   r“   r-   )rž   úsa_schema.Column[Any]rq   r   r<   rN   )rž   r©   r™   r:   rq   r   r<   rN   )r¦   r"   r<   rN   r•   )	r>   r?   r@   Ú__annotations__rŸ   r�   r¤   r’   rB   rC   s   @r+   r—   r—   ­   s|   ø… ØÓð
BØ+ð
BØ36ð
Bà	ó
Bð  +0ñ	$à%ð$ð $(ð	$ð
 ð$ð 
ó$õð


Ø&ð

Ø.1ð

à	÷

r-   r—   c                  ó”   — e Zd ZU ded<   ded<   dZded<   ded	<   	 	 	 	 	 	 dd
„Zedd„«       Zedd„«       Ze	dd„«       Z
dd„Zdd„Zy)r=   útuple[int, ...]Úserver_version_infor:   Ú
is_mariadbFr   r_   zType[MySQLIdentifierPreparer]ro   c           	     ó¶  — |€y |sB| j                   r6t        j                  ddj                  t	        t
        |«      «      ›d�«      ‚|r‰t        | j                  t        «      sJ ‚t        j                  | j                  t        t        i«      | _        | j                  | «      | _        | j                  j                  «        d| _        d| _        || _         y )NzMySQL version ú.z is not a MariaDB variant.T)r®   r   ÚInvalidRequestErrorÚjoinÚmaprN   Ú
isinstanceÚcolspecsÚdictr   Úupdate_copyr   r&   ro   r_   rk   Údelete_returningÚinsert_returning)r*   r®   r­   s      r+   rk   zMariaDBShim._set_mariadbß   s¹   € ð ÐØá˜dŸošoÜ×)Ò)à—8‘8œC¤Ð%8Ó9Õ:ð=óð ñ Ü˜dŸm™m¬TÔ2Ð2Ð2Ü ×,Ñ,Ø—‘¤¤lÐ3óˆDŒMð (,§}¡}°TÓ':ˆDÔ$Ø×$Ñ$×1Ñ1Ô3ð %)ˆDÔ!Ø$(ˆDÔ!à$ˆ�r-   c                ó   — | j                   S r3   )r­   r0   s    r+   Ú _mariadb_normalized_version_infoz,MariaDBShim._mariadb_normalized_version_infoú   s   € à×'Ñ'Ð'r-   c                ó   — | j                   S r3   )r®   r0   s    r+   Ú_is_mariadbzMariaDBShim._is_mariadbþ   s   € à�‰Ðr-   c                óV  — | j                  «       } | |¬«      }|j                  |«      \  }} |j                  |i |¤Ž}	 |j                  «       }|j	                  d«       |j                  «       d   }t        |«      |j                  «        S #  ‚ xY w# |j                  «        w xY w)N)Údbapiz!SELECT VERSION() LIKE '%MariaDB%'r   )Úimport_dbapiÚcreate_connect_argsÚconnectr   ÚexecuteÚfetchoner:   Úclose)	ÚclsÚurlr¿   r8   ÚcargsÚcparamsÚconnr   Úvals	            r+   Ú_is_mariadb_from_urlz MariaDBShim._is_mariadb_from_url  s™   € à× Ñ Ó"ˆÙ˜EÔ"ˆà ×4Ñ4°SÓ9‰ˆˆwØˆw�‰ Ð1¨Ñ1ˆð		Ø—[‘[“]ˆFØ�N‰NÐ>Ô?Ø—/‘/Ó# AÑ&ˆCô ˜“9à�J‰J�Løð	Øûð �J‰J�Lús   Á4B Á5
B ÂBÂB ÂB(c                ó^  — | j                   sJ ‚| j                  dk\  | _        | j                  dk\  | _        | j                  dk\  | _        | j                  «        | j                  d uxr | j                  dk\  | _        d| _        | j                  dk\  | _        | j                  dk\  | _	        y )N)é
   r   )rÎ   r   é   )rÎ   rÏ   )rÎ   é   T)rÎ   é   r	   )rÎ   é   rÏ   )
r®   r­   Úsupports_sequencesr¸   r¹   Ú_warn_for_known_db_issuesr4   r5   Ú_support_default_functionÚ_support_float_cast)r*   Ú
connections     r+   Ú_initialize_mariadbzMariaDBShim._initialize_mariadb  s²   € Ø�ŠÐˆà"&×":Ñ":¸gÑ"EˆÔà $× 8Ñ 8¸JÑ FˆÔà $× 8Ñ 8¸GÑ CˆÔà×&Ñ&Ô(ð ×$Ñ$¨DÐ0ò 4Ø×(Ñ(¨GÑ3ð 	Ô!ð #'ˆÔð *.×)AÑ)AÀZÑ)OˆÔ&ð $(×#;Ñ#;¸zÑ#IˆÕ r-   c                óˆ   — | j                   r6| j                  }|€J ‚|dkD  r |dk  rt        j                  d|›d�«       y y y y )N)rÎ   rÑ   )rÎ   rÑ   é	   zMariaDB aV   before 10.2.9 has known issues regarding CHECK constraints, which impact handling of NULL values with SQLAlchemy's boolean datatype (MDEV-13596). An additional issue prevents proper migrations of columns with CHECK constraints (MDEV-11114).  Please upgrade to MariaDB 10.2.9 or greater, or use the MariaDB 10.1 series, to avoid these issues.)r®   r­   r   Úwarn)r*   Úmdb_versions     r+   rÔ   z%MariaDBShim._warn_for_known_db_issues+  sU   € Ø�?Š?Ø×2Ñ2ˆKØÐ*Ð*Ð*Ø˜WÒ$¨°zÒ)AÜ—	’	ò 9DðFõð *BÐ$ð r-   N)r®   zOptional[bool]r­   r¬   r<   rd   )r<   r¬   r;   )rÇ   r   r<   r:   )r×   r    r<   rd   rc   )r>   r?   r@   rª   r5   rk   rA   r»   r½   ÚclassmethodrÌ   rØ   rÔ   r/   r-   r+   r=   r=   ×   s„   … Ø(Ó(ØÓØÐà0Ó0Ø+Ó+ð%Ø(ð%Ø?Nð%à	ó%ð6 ò(ó ð(ð òó ðð òó ðó"Jô.r-   r=   N):Ú
__future__r   Útypingr   r   r   r   r   rj   r
   Ú r   r   Ú	sa_schemar   Úenginer   rV   r   Úengine.defaultr   Úengine.interfacesr   Úsqlr   r   Úsql.compilerr   r   r   Ú
sql.schemar   Úsql.sqltypesr   r   r   Úbaser   Úmariadbr   r   r   Úengine.baser    r!   r"   r#   re   Úsql.type_apir$   r&   rE   ÚDefaultExecutionContextrP   rh   rm   r—   r=   r/   r-   r+   ú<module>rî      sÏ   ðõ #å Ý Ý Ý Ý  å 2Ý Ý #Ý Ý 'Ý Ý ,Ý -Ý Ý Ý 'Ý .Ý 'Ý %Ý (Ý  Ý  áÝ-ÝÝÝÝ)ÝÝ-Ý=Ý2ô�4˜Ñ%ô ô4˜lô ô$
 '×"AÑ"Aô $
ôN5Ð$6ô 5ô
.
˜[ô .
ôb'
˜[ô '
ôTa�.õ ar-   