ó
    ¼Rjìo  ã                   ó^  • S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKJr  S SK	J
r
  S SKJr   S SKrS SKJr  S SKJr  S SKJrJrJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SK J!r!  S SK"J#r#  S SK$J%r%  Sr&\'" 5       q(\RR                  " S5      r*S r+ " S S5      r,g! \ a	    S SKJr   Nwf = f)é    N)Údeque)Úcontextmanager)Údebug_transaction)Úzoneinfo)Úsettings)ÚImproperlyConfigured)ÚDEFAULT_DB_ALIASÚDatabaseErrorÚNotSupportedError)Úutils)ÚBaseDatabaseValidation)Úconnection_created)ÚTransactionManagementError©ÚDatabaseErrorWrapper)Úasync_unsafe)Úcached_propertyÚ	__no_db__zdjango.db.backends.basec                 ó‚   • [         R                  (       a  SS KnUR                  U 5      $ [        R
                  " U 5      $ ©Nr   )r   ÚUSE_DEPRECATED_PYTZÚpytzÚtimezoner   ÚZoneInfo)Útznamer   s     ÚHD:\diplom_project\venv\Lib\site-packages\django/db/backends/base/base.pyÚtimezone_constructorr   $   s.   € Ü×#×#Ûà�}‰}˜VÓ$Ð$Ü×Ò˜VÓ$Ð$ó    c                   ó²  • \ rS rSrSr0 r0 r0 rSrSr	Sr
SrSrSrSrSrSr\rSr\4S jrS rS r\S	 5       r\S
 5       r\S 5       r\S 5       rS rS rS r S r!S r"SFS jr#\$S 5       r%S r&\$S 5       r'S r(SFS jr)S r*S r+S r,\$S 5       r-\$S 5       r.\$S 5       r/\$S 5       r0S r1S  r2S! r3S" r4\$S# 5       r5\$S$ 5       r6\$S% 5       r7\$S& 5       r8S' r9S( r: SGS) jr;S* r<S+ r=S, r>S- r?\@S. 5       rAS/ rBS0 rCSFS1 jrDS2 rES3 rFS4 rG\S5 5       rHS6 rIS7 rJS8 rKS9 rL\S: 5       rMS; rNS< rOS= rP\@S> 5       rQ\@S? 5       rRS@ rSSGSA jrTSB rU\@SC 5       rVSFSD jrWSErXg)HÚBaseDatabaseWrapperé,   z Represent a database connection.NÚunknowni(#  c                 óÆ  • S U l         Xl        X l        [        U R                  S9U l        SU l        SU l        SU l        SU l	        / U l
        / U l        SU l        SU l        S U l        S U l        SU l        SU l        SU l        SU l        [(        R*                  " 5       U l        SU l        [0        R2                  " 5       U l        / U l        SU l        / U l        U R=                  U 5      U l        U RA                  U 5      U l!        U RE                  U 5      U l#        U RI                  U 5      U l%        U RM                  U 5      U l'        U RQ                  U 5      U l)        g )N)ÚmaxlenFr   T)*Ú
connectionÚsettings_dictÚaliasr   Úqueries_limitÚqueries_logÚforce_debug_cursorÚ
autocommitÚin_atomic_blockÚsavepoint_stateÚsavepoint_idsÚatomic_blocksÚcommit_on_exitÚneeds_rollbackÚrollback_excÚclose_atÚclosed_in_transactionÚerrors_occurredÚhealth_check_enabledÚhealth_check_doneÚ	threadingÚLockÚ_thread_sharing_lockÚ_thread_sharing_countÚ_threadÚ	get_identÚ_thread_identÚrun_on_commitÚ%run_commit_hooks_on_set_autocommit_onÚexecute_wrappersÚclient_classÚclientÚcreation_classÚcreationÚfeatures_classÚfeaturesÚintrospection_classÚintrospectionÚ	ops_classÚopsÚvalidation_classÚ
validation)Úselfr&   r'   s      r   Ú__init__ÚBaseDatabaseWrapper.__init__C   sT  € ð ˆŒð +ÔØŒ
ä ¨×(:Ñ(:Ñ;ˆÔØ"'ˆÔð
  ˆŒà$ˆÔà ˆÔàˆÔàˆÔð #ˆÔð $ˆÔØ ˆÔð ˆŒØ%*ˆÔ"Ø$ˆÔØ$)ˆÔ!Ø!&ˆÔô %.§N¢NÓ$4ˆÔ!Ø%&ˆÔ"Ü$×.Ò.Ó0ˆÔð  ˆÔð 6;ˆÔ2ð !#ˆÔà×'Ñ'¨Ó-ˆŒØ×+Ñ+¨DÓ1ˆŒØ×+Ñ+¨DÓ1ˆŒØ!×5Ñ5°dÓ;ˆÔØ—>‘> $Ó'ˆŒØ×/Ñ/°Ó5ˆ�r   c                 ón   • SU R                   R                   SU R                  < SU R                  < S3$ )NÚ<z vendor=z alias=Ú>)Ú	__class__Ú__qualname__Úvendorr'   ©rN   s    r   Ú__repr__ÚBaseDatabaseWrapper.__repr__‡   s8   € à�—‘×+Ñ+Ð,ð -Ø—k‘k‘_ G¨D¯J©J©>¸ð<ð	
r   c                 ó   • g)zg
Ensure the connection's timezone is set to `self.timezone_name` and
return whether it changed or not.
F© rW   s    r   Úensure_timezoneÚ#BaseDatabaseWrapper.ensure_timezone�   s   € ð
 r   c                 ó²   • [         R                  (       d  gU R                  S   c  [        R                  R
                  $ [        U R                  S   5      $ )a/  
Return a tzinfo of the database connection time zone.

This is only used when time zone support is enabled. When a datetime is
read from the database, it is always returned in this time zone.

When the database backend supports time zones, it doesn't matter which
time zone Django uses, as long as aware datetimes are used everywhere.
Other users connecting to the database can choose their own time zone.

When the database backend doesn't support time zones, the time zone
Django uses may be constrained by the requirements of other users of
the database.
NÚ	TIME_ZONE)r   ÚUSE_TZr&   Údatetimer   Úutcr   rW   s    r   r   ÚBaseDatabaseWrapper.timezone”   sG   € ô  ��ØØ×Ñ Ñ,Ñ4Ü×$Ñ$×(Ñ(Ð(ä'¨×(:Ñ(:¸;Ñ(GÓHÐHr   c                 óŒ   • [         R                  (       d  [         R                  $ U R                  S   c  gU R                  S   $ )z3
Name of the time zone of the database connection.
r_   ÚUTC)r   r`   r_   r&   rW   s    r   Útimezone_nameÚ!BaseDatabaseWrapper.timezone_name«   s<   € ô
 ��Ü×%Ñ%Ð%Ø×Ñ Ñ,Ñ4Øà×%Ñ% kÑ2Ð2r   c                 óH   • U R                   =(       d    [        R                  $ ©N)r*   r   ÚDEBUGrW   s    r   Úqueries_loggedÚ"BaseDatabaseWrapper.queries_logged·   s   € à×&Ñ&×8¬(¯.©.Ð8r   c                 óø   • [        U R                  5      U R                  R                  :X  a9  [        R                  " SR                  U R                  R                  5      5        [        U R                  5      $ )NzLLimit for query logging exceeded, only the last {} queries will be returned.)Úlenr)   r$   ÚwarningsÚwarnÚformatÚlistrW   s    r   ÚqueriesÚBaseDatabaseWrapper.queries»   s[   € äˆt×ÑÓ  D×$4Ñ$4×$;Ñ$;Ó;Ü�MŠMð$ß$*¡F¨4×+;Ñ+;×+BÑ+BÓ$Côô �D×$Ñ$Ó%Ð%r   c                 ó   • [        S5      e)z)Return a tuple of the database's version.zNsubclasses of BaseDatabaseWrapper may require a get_database_version() method.©ÚNotImplementedErrorrW   s    r   Úget_database_versionÚ(BaseDatabaseWrapper.get_database_versionÄ   s   € ä!ðó
ð 	
r   c                 ó€  • U R                   R                  b§  U R                  5       U R                   R                  :  a~  SR                  [	        [
        U R                  5       5      5      nSR                  [	        [
        U R                   R                  5      5      n[        U R                   SU SU S35      egg)zS
Raise an error if the database version isn't supported by this
version of Django.
NÚ.Ú z or later is required (found z).)rG   Úminimum_database_versionrx   ÚjoinÚmapÚstrr   Údisplay_name)rN   Ú
db_versionÚmin_db_versions      r   Ú check_database_version_supportedÚ4BaseDatabaseWrapper.check_database_version_supportedË   s¨   € ð �M‰M×2Ñ2Ñ>Ø×)Ñ)Ó+¨d¯m©m×.TÑ.TÓTàŸ™¤#¤c¨4×+DÑ+DÓ+FÓ"GÓHˆJØ ŸX™X¤c¬#¨t¯}©}×/UÑ/UÓ&VÓWˆNÜ#Ø×$Ñ$Ð% Q ~Ð&6ð 7Ø$˜ Rð)óð ð	 Uð ?r   c                 ó   • [        S5      e)z<Return a dict of parameters suitable for get_new_connection.zNsubclasses of BaseDatabaseWrapper may require a get_connection_params() methodrv   rW   s    r   Úget_connection_paramsÚ)BaseDatabaseWrapper.get_connection_paramsÝ   ó   € ä!ðó
ð 	
r   c                 ó   • [        S5      e)z"Open a connection to the database.zKsubclasses of BaseDatabaseWrapper may require a get_new_connection() methodrv   )rN   Úconn_paramss     r   Úget_new_connectionÚ&BaseDatabaseWrapper.get_new_connectionä   r‰   r   c                 óŒ   • U R                   [        ;  a0  U R                  5         [        R                  U R                   5        gg)z,Initialize the database connection settings.N)r'   ÚRAN_DB_VERSION_CHECKr„   ÚaddrW   s    r   Úinit_connection_stateÚ)BaseDatabaseWrapper.init_connection_stateë   s4   € ð �:‰:Ô1Ó1Ø×1Ñ1Ô3Ü ×$Ñ$ T§Z¡ZÕ0ð 2r   c                 ó   • [        S5      e)z9Create a cursor. Assume that a connection is established.zFsubclasses of BaseDatabaseWrapper may require a create_cursor() methodrv   ©rN   Únames     r   Úcreate_cursorÚ!BaseDatabaseWrapper.create_cursorò   s   € ä!ØTó
ð 	
r   c                 ó  • U R                  5         SU l        / U l        / U l        SU l        U R
                  S   U l        U R
                  S   nUc  SO[        R                  " 5       U-   U l	        SU l
        SU l        SU l        U R                  5       nU R                  U5      U l        U R!                  U R
                  S   5        U R#                  5         [$        R&                  " U R(                  U S9  / U l        g)z>Connect to the database. Assume that the connection is closed.FÚCONN_HEALTH_CHECKSÚCONN_MAX_AGENTÚ
AUTOCOMMIT)Úsenderr%   )Úcheck_settingsr,   r.   r/   r1   r&   r6   ÚtimeÚ	monotonicr3   r4   r5   r7   r‡   rŒ   r%   Úset_autocommitr‘   r   ÚsendrT   r?   )rN   Úmax_ager‹   s      r   ÚconnectÚBaseDatabaseWrapper.connectú   sæ   € ð 	×ÑÔà$ˆÔØˆÔØˆÔØ#ˆÔà$(×$6Ñ$6Ð7KÑ$LˆÔ!Ø×$Ñ$ ^Ñ4ˆØ '¡™´T·^²^Ó5EÈÑ5OˆŒØ%*ˆÔ"Ø$ˆÔà!%ˆÔà×0Ñ0Ó2ˆØ×1Ñ1°+Ó>ˆŒØ×Ñ˜D×.Ñ.¨|Ñ<Ô=Ø×"Ñ"Ô$Ü×Ò t§~¡~À$ÒGàˆÕr   c                 ó€   • U R                   S   b.  [        R                  (       d  [        SU R                  -  5      eg g )Nr_   z=Connection '%s' cannot set TIME_ZONE because USE_TZ is False.)r&   r   r`   r   r'   rW   s    r   r�   Ú"BaseDatabaseWrapper.check_settings  s?   € Ø×Ñ˜kÑ*Ñ6¼x¿¿Ü&ØOØ—*‘*ñóð ð @OÐ6r   c                 óŒ   • U R                   c&  U R                     U R                  5         SSS5        gg! , (       d  f       g= f)z;Guarantee that a connection to the database is established.N)r%   Úwrap_database_errorsr£   rW   s    r   Úensure_connectionÚ%BaseDatabaseWrapper.ensure_connection  s4   € ð �?‰?Ñ"Ø×*Ó*Ø—‘”÷ +Ð*ð #ß*Õ*ús	   š5µ
Ac                 ó�   • U R                  5         U R                  (       a  U R                  U5      nU$ U R                  U5      nU$ )zI
Validate the connection is usable and perform database cursor wrapping.
)Úvalidate_thread_sharingrk   Úmake_debug_cursorÚmake_cursor)rN   ÚcursorÚwrapped_cursors      r   Ú_prepare_cursorÚ#BaseDatabaseWrapper._prepare_cursor%  sI   € ð 	×$Ñ$Ô&Ø××Ø!×3Ñ3°FÓ;ˆNð Ðð "×-Ñ-¨fÓ5ˆNØÐr   c                 óÐ   • U R                  5         U R                  5         U R                     U R                  U R	                  U5      5      sS S S 5        $ ! , (       d  f       g = fri   )Úclose_if_health_check_failedr©   r¨   r±   r–   r”   s     r   Ú_cursorÚBaseDatabaseWrapper._cursor0  sH   € Ø×)Ñ)Ô+Ø×ÑÔ Ø×&Ó&Ø×'Ñ'¨×(:Ñ(:¸4Ó(@ÓA÷ '×&×&ús   ­ AÁ
A%c                 ó   • U R                   bF  [        U S5         U R                     U R                   R                  5       sS S S 5        sS S S 5        $ g ! , (       d  f       O= fS S S 5        g ! , (       d  f       g = f)NÚCOMMIT)r%   r   r¨   ÚcommitrW   s    r   Ú_commitÚBaseDatabaseWrapper._commit6  sS   € Ø�?‰?Ñ&Ü" 4¨Õ2°D×4MÓ4MØ—‘×-Ñ-Ó/÷ 5NÐ4M×2Ñ2ð 'ß4MÕ4Mú×2×2Ö2úó"   šA/§AÁ	A/Á
A#	ÁA/Á/
A=c                 ó   • U R                   bF  [        U S5         U R                     U R                   R                  5       sS S S 5        sS S S 5        $ g ! , (       d  f       O= fS S S 5        g ! , (       d  f       g = f)NÚROLLBACK)r%   r   r¨   ÚrollbackrW   s    r   Ú	_rollbackÚBaseDatabaseWrapper._rollback;  sS   € Ø�?‰?Ñ&Ü" 4¨Õ4°d×6OÓ6OØ—‘×/Ñ/Ó1÷ 7PÐ6O×4Ñ4ð 'ß6OÕ6Oú×4×4Ö4úr¼   c                 ó    • U R                   b0  U R                     U R                   R                  5       sS S S 5        $ g ! , (       d  f       g = fri   )r%   r¨   ÚcloserW   s    r   Ú_closeÚBaseDatabaseWrapper._close@  s9   € Ø�?‰?Ñ&Ø×*Ó*Ø—‘×,Ñ,Ó.÷ +Ñ*ð 'ß*Õ*ús	   š?¿
Ac                 ó"   • U R                  5       $ )z3Create a cursor, opening a connection if necessary.)rµ   rW   s    r   r¯   ÚBaseDatabaseWrapper.cursorG  s   € ð �|‰|‹~Ðr   c                 ó€   • U R                  5         U R                  5         U R                  5         SU l        SU l        g)z.Commit a transaction and reset the dirty flag.FTN)r¬   Úvalidate_no_atomic_blockrº   r5   r@   rW   s    r   r¹   ÚBaseDatabaseWrapper.commitL  s5   € ð 	×$Ñ$Ô&Ø×%Ñ%Ô'Ø�‰Œà$ˆÔØ59ˆÕ2r   c                 óŽ   • U R                  5         U R                  5         U R                  5         SU l        SU l        / U l        g)z1Roll back a transaction and reset the dirty flag.FN)r¬   rÉ   rÀ   r5   r1   r?   rW   s    r   r¿   ÚBaseDatabaseWrapper.rollbackV  s>   € ð 	×$Ñ$Ô&Ø×%Ñ%Ô'Ø�‰Ôà$ˆÔØ#ˆÔØˆÕr   c                 ó8  • U R                  5         / U l        U R                  (       d  U R                  c  g U R	                  5         U R
                  (       a  SU l        SU l        gSU l        g! U R
                  (       a  SU l        SU l        f SU l        f = f)z%Close the connection to the database.NT)r¬   r?   r4   r%   rÄ   r,   r1   rW   s    r   rÃ   ÚBaseDatabaseWrapper.closea  s�   € ð 	×$Ñ$Ô&ØˆÔð
 ×%×%¨¯©Ñ)@Øð	'Ø�K‰KŒMà×#×#Ø-1�Ô*Ø&*�Õ#à"&�•øð	 ×#×#Ø-1�Ô*Ø&*�Õ#à"&�•ús   ¸A0 Á0)Bc                 ó¬   • U R                  5        nUR                  U R                  R                  U5      5        S S S 5        g ! , (       d  f       g = fri   )r¯   ÚexecuterK   Úsavepoint_create_sql©rN   Úsidr¯   s      r   Ú
_savepointÚBaseDatabaseWrapper._savepointw  ó2   € Ø�[‰[Œ]˜fØ�N‰N˜4Ÿ8™8×8Ñ8¸Ó=Ô>÷ �]Ž]úó   ‘+AÁ
Ac                 ó¬   • U R                  5        nUR                  U R                  R                  U5      5        S S S 5        g ! , (       d  f       g = fri   )r¯   rÐ   rK   Úsavepoint_rollback_sqlrÒ   s      r   Ú_savepoint_rollbackÚ'BaseDatabaseWrapper._savepoint_rollback{  s2   € Ø�[‰[Œ]˜fØ�N‰N˜4Ÿ8™8×:Ñ:¸3Ó?Ô@÷ �]Ž]úr×   c                 ó¬   • U R                  5        nUR                  U R                  R                  U5      5        S S S 5        g ! , (       d  f       g = fri   )r¯   rÐ   rK   Úsavepoint_commit_sqlrÒ   s      r   Ú_savepoint_commitÚ%BaseDatabaseWrapper._savepoint_commit  rÖ   r×   c                 óf   • U R                   R                  =(       a    U R                  5       (       + $ ri   )rG   Úuses_savepointsÚget_autocommitrW   s    r   Ú_savepoint_allowedÚ&BaseDatabaseWrapper._savepoint_allowedƒ  s#   € à�}‰}×,Ñ,×J°T×5HÑ5HÓ5JÔ1JÐJr   c                 ó  • U R                  5       (       d  g[        R                  " 5       n[        U5      R	                  SS5      nU =R
                  S-  sl        SX R
                  4-  nU R                  5         U R                  U5        U$ )zÀ
Create a savepoint inside the current transaction. Return an
identifier for the savepoint that will be used for the subsequent
rollback or commit. Do nothing if savepoints are not supported.
NÚ-Ú é   zs%s_x%d)rã   r<   r=   r€   Úreplacer-   r¬   rÔ   )rN   Úthread_identÚtidrÓ   s       r   Ú	savepointÚBaseDatabaseWrapper.savepoint‰  s|   € ð ×&Ñ&×(Ñ(Øä×(Ò(Ó*ˆÜ�,Ó×'Ñ'¨¨RÓ0ˆà×Ò Ñ!ÕØ˜3× 4Ñ 4Ð5Ñ5ˆà×$Ñ$Ô&Ø�‰˜Ôàˆ
r   c                 óä   • U R                  5       (       d  gU R                  5         U R                  U5        U R                   VVVs/ s H  u  p#nX;  d  M  X#U4PM     snnnU l        gs  snnnf )zG
Roll back to a savepoint. Do nothing if savepoints are not supported.
N)rã   r¬   rÚ   r?   )rN   rÓ   ÚsidsÚfuncÚrobusts        r   Úsavepoint_rollbackÚ&BaseDatabaseWrapper.savepoint_rollbackž  sn   € ð
 ×&Ñ&×(Ñ(Øà×$Ñ$Ô&Ø× Ñ  Ô%ð
 )-×(:Ò(:õ
â(:Ñ$�˜VØ‰ó !ˆT˜Ó Ù(:ó
ˆÕùô 
s   ÁA+ÁA+c                 ór   • U R                  5       (       d  gU R                  5         U R                  U5        g)zB
Release a savepoint. Do nothing if savepoints are not supported.
N)rã   r¬   rÞ   )rN   rÓ   s     r   Úsavepoint_commitÚ$BaseDatabaseWrapper.savepoint_commit°  s0   € ð
 ×&Ñ&×(Ñ(Øà×$Ñ$Ô&Ø×Ñ˜sÕ#r   c                 ó   • SU l         g)zI
Reset the counter used to generate unique savepoint ids in this thread.
r   N)r-   rW   s    r   Úclean_savepointsÚ$BaseDatabaseWrapper.clean_savepoints»  s   € ð
  !ˆÕr   c                 ó   • [        S5      e)zB
Backend-specific implementation to enable or disable autocommit.
zHsubclasses of BaseDatabaseWrapper may require a _set_autocommit() methodrv   )rN   r+   s     r   Ú_set_autocommitÚ#BaseDatabaseWrapper._set_autocommitÄ  s   € ô "ØVó
ð 	
r   c                 ó:   • U R                  5         U R                  $ )zGet the autocommit state.)r©   r+   rW   s    r   râ   Ú"BaseDatabaseWrapper.get_autocommitÎ  s   € à×ÑÔ Ø�‰Ðr   c                 óè  • U R                  5         U R                  5         U R                  5         U=(       a    U(       + =(       a    [        U S5      nU(       a  U R	                  5         O?U(       a  U R                  U5        O&[        U S5         U R                  U5        SSS5        Xl        U(       a*  U R                  (       a  U R                  5         SU l        ggg! , (       d  f       NF= f)a¡  
Enable or disable autocommit.

The usual way to start a transaction is to turn autocommit off.
SQLite does not properly start a transaction when disabling
autocommit. To avoid this buggy behavior and to actually enter a new
transaction, an explicit BEGIN is required. Using
force_begin_transaction_with_broken_autocommit=True will issue an
explicit BEGIN with SQLite. This option will be ignored for other
backends.
Ú#_start_transaction_under_autocommitÚBEGINNF)
rÉ   r´   r©   Úhasattrr   rû   r   r+   r@   Úrun_and_clear_commit_hooks)rN   r+   Ú.force_begin_transaction_with_broken_autocommitÚ"start_transaction_under_autocommits       r   r    Ú"BaseDatabaseWrapper.set_autocommitÓ  sÂ   € ð 	×%Ñ%Ô'Ø×)Ñ)Ô+Ø×ÑÔ ð ;÷ EØ”÷Eä˜ÐCÓDð 	+ö .Ø×4Ñ4Õ6ÞØ× Ñ  Õ,ä" 4¨Õ1Ø×$Ñ$ ZÔ0÷ 2à$Œæ˜$×D×DØ×+Ñ+Ô-Ø9>ˆDÕ6ð Eˆ:÷	 2Õ1ús   ÂC#Ã#
C1c                 óR   • U R                   (       d  [        S5      eU R                  $ )z9Get the "needs rollback" flag -- for *advanced use* only.ú<The rollback flag doesn't work outside of an 'atomic' block.©r,   r   r1   rW   s    r   Úget_rollbackÚ BaseDatabaseWrapper.get_rollbackø  s)   € à×#×#Ü,ØNóð ð ×"Ñ"Ð"r   c                 óH   • U R                   (       d  [        S5      eXl        g)zD
Set or unset the "needs rollback" flag -- for *advanced use* only.
r  Nr	  )rN   r¿   s     r   Úset_rollbackÚ BaseDatabaseWrapper.set_rollback   s%   € ð ×#×#Ü,ØNóð ð 'Õr   c                 ó<   • U R                   (       a  [        S5      eg)z,Raise an error if an atomic block is active.z3This is forbidden when an 'atomic' block is active.N)r,   r   rW   s    r   rÉ   Ú,BaseDatabaseWrapper.validate_no_atomic_block
  s    € à××Ü,ØEóð ð  r   c                 óR   • U R                   (       a  [        S5      U R                  eg )NzlAn error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.)r1   r   r2   rW   s    r   Úvalidate_no_broken_transactionÚ2BaseDatabaseWrapper.validate_no_broken_transaction  s.   € Ø××Ü,ðGóð ×$Ñ$ð%ð r   c              #   ó    #   • U R                  5       n Sv •  U(       a  U R                  5         gg! U(       a  U R                  5         f f = f7f)z*
Disable foreign key constraint checking.
N)Údisable_constraint_checkingÚenable_constraint_checking)rN   Údisableds     r   Úconstraint_checks_disabledÚ.BaseDatabaseWrapper.constraint_checks_disabled  sE   é € ð
 ×3Ñ3Ó5ˆð	2ÛæØ×/Ñ/Õ1ð øŽxØ×/Ñ/Õ1ð üs   ‚A”1 ˜A±AÁAc                 ó   • g)z­
Backends can implement as needed to temporarily disable foreign key
constraint checking. Should return True if the constraints were
disabled and will need to be reenabled.
Fr[   rW   s    r   r  Ú/BaseDatabaseWrapper.disable_constraint_checking&  s   € ð r   c                 ó   • g)zP
Backends can implement as needed to re-enable foreign key constraint
checking.
Nr[   rW   s    r   r  Ú.BaseDatabaseWrapper.enable_constraint_checking.  ó   € ð
 	r   c                 ó   • g)zË
Backends can override this method if they can apply constraint
checking (e.g. via "SET CONSTRAINTS ALL IMMEDIATE"). Should raise an
IntegrityError if any invalid foreign key references are encountered.
Nr[   )rN   Útable_namess     r   Úcheck_constraintsÚ%BaseDatabaseWrapper.check_constraints5  s   € ð 	r   c                 ó   • [        S5      e)zç
Test if the database connection is usable.

This method may assume that self.connection is not None.

Actual implementations should take care not to raise exceptions
as that may prevent Django from recycling unusable connections.
zCsubclasses of BaseDatabaseWrapper may require an is_usable() methodrv   rW   s    r   Ú	is_usableÚBaseDatabaseWrapper.is_usable?  s   € ô "ØQó
ð 	
r   c                 ó¼   • U R                   b"  U R                  (       a  U R                  (       a  gU R                  5       (       d  U R	                  5         SU l        g)z5Close existing connection if it fails a health check.NT)r%   r6   r7   r$  rÃ   rW   s    r   r´   Ú0BaseDatabaseWrapper.close_if_health_check_failedL  sA   € ð �O‰OÑ#Ø×,×,Ø×%×%àà�~‰~×ÑØ�J‰JŒLØ!%ˆÕr   c                 ó¢  • U R                   bÂ  SU l        U R                  5       U R                  S   :w  a  U R	                  5         gU R
                  (       a5  U R                  5       (       a  SU l        SU l        OU R	                  5         gU R                  b5  [        R                  " 5       U R                  :¼  a  U R	                  5         gggg)zg
Close the current connection if unrecoverable errors have occurred
or if it outlived its maximum age.
NFr›   T)
r%   r7   râ   r&   rÃ   r5   r$  r3   rž   rŸ   rW   s    r   Úclose_if_unusable_or_obsoleteÚ1BaseDatabaseWrapper.close_if_unusable_or_obsoleteY  sª   € ð
 �?‰?Ñ&Ø%*ˆDÔ"ð ×"Ñ"Ó$¨×(:Ñ(:¸<Ñ(HÓHØ—
‘
”Øð ×#×#Ø—>‘>×#Ñ#Ø+0�DÔ(Ø-1�DÕ*à—J‘J”LØà�}‰}Ñ(¬T¯^ª^Ó-=ÀÇÁÓ-NØ—
‘
”Øð .OÐ(ð% 'r   c                 ón   • U R                      U R                  S:„  sS S S 5        $ ! , (       d  f       g = fr   ©r:   r;   rW   s    r   Úallow_thread_sharingÚ(BaseDatabaseWrapper.allow_thread_sharingv  s%   € à×&Ó&Ø×-Ñ-°Ñ1÷ '×&×&ús   �&¦
4c                 óz   • U R                      U =R                  S-  sl        S S S 5        g ! , (       d  f       g = f)Nrè   r,  rW   s    r   Úinc_thread_sharingÚ&BaseDatabaseWrapper.inc_thread_sharing{  s(   € Ø×&Ó&Ø×&Ò&¨!Ñ+Õ&÷ '×&Ö&ús   �,¬
:c                 ó°   • U R                      U R                  S::  a  [        S5      eU =R                  S-  sl        S S S 5        g ! , (       d  f       g = f)Nr   z5Cannot decrement the thread sharing count below zero.rè   )r:   r;   ÚRuntimeErrorrW   s    r   Údec_thread_sharingÚ&BaseDatabaseWrapper.dec_thread_sharing  sH   € Ø×&Ó&Ø×)Ñ)¨QÓ.Ü"ØKóð ð ×&Ò&¨!Ñ+Õ&÷ '×&Ö&ús   �1AÁ
Ac           	      óì   • U R                   (       dc  U R                  [        R                  " 5       :X  d?  [	        SU R
                  < SU R                  < S[        R                  " 5       < S35      egg)a  
Validate that the connection isn't accessed by another thread than the
one which originally created it, unless the connection was explicitly
authorized to be shared between threads (via the `inc_thread_sharing()`
method). Raise an exception if the validation fails.
ziDatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias 'z' was created in thread id z and this is thread id r{   N)r-  r>   r<   r=   r
   r'   rW   s    r   r¬   Ú+BaseDatabaseWrapper.validate_thread_sharing‡  s[   € ð ×)×)¨T×-?Ñ-?Ä7×CTÒCTÓCVÓ-VÝð $(§:¤:¨t×/AÔ/AÄ7×CTÒCTÖCVðXóð ð .WÐ)r   c                 ó   • g)zf
Hook to do any database check or preparation, generally called before
migrating a project or an app.
Nr[   rW   s    r   Úprepare_databaseÚ$BaseDatabaseWrapper.prepare_database˜  r  r   c                 ó   • [        U 5      $ )zs
Context manager and decorator that re-throws backend-specific database
exceptions using Django's common wrappers.
r   rW   s    r   r¨   Ú(BaseDatabaseWrapper.wrap_database_errorsŸ  s   € ô $ DÓ)Ð)r   c                 ó"   • U R                  5       $ )z€
Return a cursor that tries to avoid caching in the database (if
supported by the database), otherwise return a regular cursor.
)r¯   rW   s    r   Úchunked_cursorÚ"BaseDatabaseWrapper.chunked_cursor§  s   € ð
 �{‰{‹}Ðr   c                 ó.   • [         R                  " X5      $ )z:Create a cursor that logs all queries in self.queries_log.)r   ÚCursorDebugWrapper©rN   r¯   s     r   r­   Ú%BaseDatabaseWrapper.make_debug_cursor®  s   € ä×'Ò'¨Ó5Ð5r   c                 ó.   • [         R                  " X5      $ )z&Create a cursor without debug logging.)r   ÚCursorWrapperrB  s     r   r®   ÚBaseDatabaseWrapper.make_cursor²  s   € ä×"Ò" 6Ó0Ð0r   c              #   óð   #   • U R                   SL n U R                  5        nUv •  SSS5        U(       a  U R                  5         gg! , (       d  f       N'= f! U(       a  U R                  5         f f = f7f)a  
Context manager that ensures that a connection is established, and
if it opened one, closes it to avoid leaving a dangling connection.
This is useful for operations outside of the request-response cycle.

Provide a cursor: with self.temporary_connection() as cursor: ...
N)r%   r¯   rÃ   )rN   Ú
must_closer¯   s      r   Útemporary_connectionÚ(BaseDatabaseWrapper.temporary_connection¶  s]   é € ð —_‘_¨Ð,ˆ
ð	Ø—‘” &Ø’÷ ö Ø—
‘
•ð ÷ •ûö Ø—
‘
•ð üs1   ‚A6’A ¢A§A ¯A6Á
AÁA ÁA3Á3A6c              #   óü   #   • U R                  0 U R                  ESS0E[        S9n UR                  5        nUv •  SSS5        UR	                  5         g! , (       d  f       N= f! UR	                  5         f = f7f)aA  
Return a cursor from an alternative connection to be used when there is
no need to access the main database, specifically for test db
creation/deletion. This also prevents the production database from
being exposed to potential child threads while (or after) the test
database is destroyed. Refs #10868, #17786, #16969.
ÚNAMEN)r'   )rT   r&   ÚNO_DB_ALIASr¯   rÃ   )rN   Úconnr¯   s      r   Ú_nodb_cursorÚ BaseDatabaseWrapper._nodb_cursorÇ  sd   é € ð �~‰~ÐB ×!3Ñ!3ÐB°V¸TÑBÌ+ˆ~ÐVˆð	Ø—‘” &Ø’÷ ð �J‰J�L÷ •ûð �J‰J�Lüs2   ‚%A<¨A' ¸A½A' ÁA<Á
A$Á A' Á'A9Á9A<c                 ó^   • U R                   c  [        S5      eU R                   " U /UQ70 UD6$ )z7
Return a new instance of this backend's SchemaEditor.
zFThe SchemaEditorClass attribute of this database wrapper is still None)ÚSchemaEditorClassrw   )rN   ÚargsÚkwargss      r   Úschema_editorÚ!BaseDatabaseWrapper.schema_editor×  s=   € ð ×!Ñ!Ñ)Ü%ØXóð ð ×%Ò% dÐ<¨TÒ<°VÑ<Ð<r   c                 ó   • [        U5      (       d  [        S5      eU R                  (       a1  U R                  R	                  [        U R                  5      X45        g U R                  5       (       d  [        S5      eU(       a	   U" 5         g U" 5         g ! [         a-  n[        R                  SUR                   S3USS9   S nAg S nAff = f)Nz*on_commit()'s callback must be a callable.z;on_commit() cannot be used in manual transaction managementúError calling z in on_commit() (%s).T©Úexc_info)ÚcallableÚ	TypeErrorr,   r?   ÚappendÚsetr.   râ   r   Ú	ExceptionÚloggerÚerrorrU   )rN   rð   rñ   Úes       r   Ú	on_commitÚBaseDatabaseWrapper.on_commitá  s¶   € Ü˜�~‰~ÜÐHÓIÐIØ××à×Ñ×%Ñ%¤s¨4×+=Ñ+=Ó'>ÀÐ&MÕNØ×$Ñ$×&Ñ&Ü,ØMóð ö ðÙ•Fñ •øô !ó Ü—L‘LØ(¨×):Ñ):Ð(;Ð;PÐQØØ!%ð !ö ûðús   ÂB Â
CÂ #CÃCc                 ó6  • U R                  5         U R                  n/ U l        U(       a5  UR                  S5      u  p#nU(       a	   U" 5         OU" 5         U(       a  M4  g g ! [         a-  n[        R                  SUR                   S3USS9   S nAN=S nAff = f)Nr   rX  z( in on_commit() during transaction (%s).TrY  )rÉ   r?   Úpopr_  r`  ra  rU   )rN   Úcurrent_run_on_commitÚ_rð   rñ   rb  s         r   r  Ú.BaseDatabaseWrapper.run_and_clear_commit_hooksú  s–   € Ø×%Ñ%Ô'Ø $× 2Ñ 2ÐØˆÔÞ#Ø3×7Ñ7¸Ó:‰OˆA�VÞðÙ•Fñ ”÷ $Ò#øô
 !ó Ü—L‘LØ(¨×):Ñ):Ð(;ð <,ð -àØ!%ð	 !ö ûðús   ÁA! Á!
BÁ+#BÂBc              #   ó¾   #   • U R                   R                  U5         Sv •  U R                   R                  5         g! U R                   R                  5         f = f7f)zd
Return a context manager under which the wrapper is applied to suitable
database query executions.
N)rA   r]  rf  )rN   Úwrappers     r   Úexecute_wrapperÚ#BaseDatabaseWrapper.execute_wrapper  sG   é € ð 	×Ñ×$Ñ$ WÔ-ð	(Ûà×!Ñ!×%Ñ%Õ'øˆD×!Ñ!×%Ñ%Õ'üs   ‚AŸ> £A¾AÁAc                 ó‚   • [         R                  " U R                  5      nUc  U R                  n[	        U 5      " X!5      $ )za
Return a copy of this connection.

For tests that require two connections to the same database.
)ÚcopyÚdeepcopyr&   r'   Útype)rN   r'   r&   s      r   ro  ÚBaseDatabaseWrapper.copy  s5   € ô Ÿš d×&8Ñ&8Ó9ˆØ‰=Ø—J‘JˆEÜ�DŒz˜-Ó/Ð/r   )r>   r;   r:   r'   r/   r+   rC   r3   r4   r0   r%   rE   r5   rA   rG   r*   r7   r6   r,   rI   r1   rK   r)   r2   r@   r?   r.   r-   r&   rM   ri   )F)YÚ__name__Ú
__module__rU   Ú__firstlineno__Ú__doc__Ú
data_typesÚdata_types_suffixÚdata_type_check_constraintsrK   rV   r�   rR  rB   rD   rF   rH   rJ   r   rL   r(   r	   rO   rX   r\   r   r   rf   Úpropertyrk   rs   rx   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$  r´   r)  r-  r0  r4  r¬   r9  r¨   r>  r­   r®   rI  rO  rU  rc  r  rl  ro  Ú__static_attributes__r[   r   r   r    r    ,   sË  † Ù*ð €JàÐà"$ÐØ
€CØ€FØ€LØÐà€LØ€NØ€NØÐØ€IØ-Ðà€Mà,<ô B6òH
òð ñIó ðIð, ñ	3ó ð	3ð ñ9ó ð9ð ñ&ó ð&ò
òò$
ò
ò1ô
ð ñ ó ð ò4ð ñó ðò	ôBò0ò
2ò
/ð ñó ðð ñ:ó ð:ð ñ ó ð ð ñ'ó ð'ò*?òAò?òKð ñó ðð( ñ
ó ð
ð" ñ$ó ð$ð ñ!ó ð!ò
òð JOô#?òJ#ò'òò%ð ñ	2ó ð	2òòôò
ò&òð: ñ2ó ð2ò,ò,òò"ð ñ*ó ð*òò6ò1ð ñó ðð  ñó ðò=ôò2ð& ñ	(ó ð	(÷	0r   r    )-r<   ro  ra   Úloggingr8   rž   ro   Úcollectionsr   Ú
contextlibr   Údjango.db.backends.utilsr   r   ÚImportErrorÚ	backportsÚdjango.confr   Údjango.core.exceptionsr   Ú	django.dbr	   r
   r   Údjango.db.backendsr   Ú"django.db.backends.base.validationr   Údjango.db.backends.signalsr   Údjango.db.transactionr   Údjango.db.utilsr   Údjango.utils.asyncior   Údjango.utils.functionalr   rM  r^  r�   Ú	getLoggerr`  r   r    r[   r   r   Ú<module>r�     s‘   ðÛ Û Û Û Û Û Û Ý Ý %å 6ð#Ûõ !Ý 7ß HÑ HÝ $Ý EÝ 9Ý <Ý 0Ý -Ý 3à€Ù“uÐ à	×	Ò	Ð4Ó	5€ò%÷v0ò v0øð; ó #ß"ð#ús   °B ÂB,Â+B,