
    ho                     6   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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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J r   S SK!J"r"  S SK#J$r$  Sr%\&" 5       q'\RP                  " S5      r) " S S5      r*g)    N)deque)contextmanager)settings)ImproperlyConfigured)DEFAULT_DB_ALIASDatabaseErrorNotSupportedError)utils)BaseDatabaseValidation)connection_created)debug_transaction)TransactionManagementError)DatabaseErrorWrapperProgrammingError)async_unsafe)cached_property	__no_db__zdjango.db.backends.basec                      \ 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      N/var/www/html/env/lib/python3.13/site-packages/django/db/backends/base/base.py__init__BaseDatabaseWrapper.__init__5   sT     +
 (:(:;"'
  $  # $  %*"$$)!!& %.NN$4!%&"$..0   6;2 !#''-++D1++D1!55d;>>$'//5    c                 n    SU R                   R                   SU R                  < SU R                  < S3$ )N<z vendor=z alias=>)	__class____qualname__vendorr   rC   s    rD   __repr__BaseDatabaseWrapper.__repr__y   s8    ++, -kk_GDJJ><	
rG   c                     g)zg
Ensure the connection's timezone is set to `self.timezone_name` and
return whether it changed or not.
F rN   s    rD   ensure_timezone#BaseDatabaseWrapper.ensure_timezone   s    
 rG   c                     [         R                  (       d  gU R                  S   c  [        R                  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   datetimetimezoneutczoneinfoZoneInforN   s    rD   rY   BaseDatabaseWrapper.timezone   sM      ,4$$((($$T%7%7%DEErG   c                     [         R                  (       d  [         R                  $ U R                  S   c  gU R                  S   $ )z3
Name of the time zone of the database connection.
rV   UTC)r   rW   rV   r   rN   s    rD   timezone_name!BaseDatabaseWrapper.timezone_name   s<    
 %%%,4%%k22rG   c                 H    U R                   =(       d    [        R                  $ N)r   r   DEBUGrN   s    rD   queries_logged"BaseDatabaseWrapper.queries_logged   s    &&8(..8rG   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listrN   s    rD   queriesBaseDatabaseWrapper.queries   s[    t D$4$4$;$;;MM$$*F4+;+;+B+B$C D$$%%rG   c                     [        S5      e)z)Return a tuple of the database's version.zNsubclasses of BaseDatabaseWrapper may require a get_database_version() method.NotImplementedErrorrN   s    rD   get_database_version(BaseDatabaseWrapper.get_database_version   s    !
 	
rG   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).)r<   minimum_database_versionrr   joinmapstrr	   display_name)rC   
db_versionmin_db_versions      rD    check_database_version_supported4BaseDatabaseWrapper.check_database_version_supported   s     MM22>))+dmm.T.TT#c4+D+D+F"GHJ XXc#t}}/U/U&VWN#$$%Q~&6 7$R) 	 U ?rG   c                     [        S5      e)z<Return a dict of parameters suitable for get_new_connection.zNsubclasses of BaseDatabaseWrapper may require a get_connection_params() methodrp   rN   s    rD   get_connection_params)BaseDatabaseWrapper.get_connection_params       !
 	
rG   c                     [        S5      e)z"Open a connection to the database.zKsubclasses of BaseDatabaseWrapper may require a get_new_connection() methodrp   )rC   conn_paramss     rD   get_new_connection&BaseDatabaseWrapper.get_new_connection   r   rG   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~   addrN   s    rD   init_connection_state)BaseDatabaseWrapper.init_connection_state   s4     ::11113 $$TZZ0 2rG   c                     [        S5      e)z9Create a cursor. Assume that a connection is established.zFsubclasses of BaseDatabaseWrapper may require a create_cursor() methodrp   rC   names     rD   create_cursor!BaseDatabaseWrapper.create_cursor   s    !T
 	
rG   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$   r&   r   r+   time	monotonicr(   r)   r*   r,   r   r   r   set_autocommitr   r   sendrK   r4   )rC   max_ager   s      rD   connectBaseDatabaseWrapper.connect   s     	$#$($6$67K$L!$$^4 'T^^5E5O%*"$!%00211+>D..|<=""$t~~$GrG   c                     U R                   S   b.  [        R                  (       d  [        SU R                  -  5      eg g )NrV   z=Connection '%s' cannot set TIME_ZONE because USE_TZ is False.)r   r   rW   r   r   rN   s    rD   r   "BaseDatabaseWrapper.check_settings  s?    k*6x&O**  @O6rG   c                     U R                   cS  U R                  (       a  U R                  (       a  [        S5      e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.Nz0Cannot open a new connection in an atomic block.)r   r!   r)   r   wrap_database_errorsr   rN   s    rD   ensure_connection%BaseDatabaseWrapper.ensure_connection  sY     ??"##(B(B&F  ** +* #
 +*s   A""
A0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_sharingre   make_debug_cursormake_cursor)rC   cursorwrapped_cursors      rD   _prepare_cursor#BaseDatabaseWrapper._prepare_cursor  sI     	$$&!33F;N  "--f5NrG   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rc   )close_if_health_check_failedr   r   r   r   r   s     rD   _cursorBaseDatabaseWrapper._cursor&  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   commitrN   s    rD   _commitBaseDatabaseWrapper._commit,  sS    ??&"42D4M4M--/ 5N4M22 '4M4M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   rollbackrN   s    rD   	_rollbackBaseDatabaseWrapper._rollback1  sS    ??&"44d6O6O//1 7P6O44 '6O6O444r   c                     U R                   b0  U R                     U R                   R                  5       sS S S 5        $ g ! , (       d  f       g = frc   )r   r   closerN   s    rD   _closeBaseDatabaseWrapper._close6  s9    ??&**,,. +* '**s	   ?
Ac                 "    U R                  5       $ )z3Create a cursor, opening a connection if necessary.)r   rN   s    rD   r   BaseDatabaseWrapper.cursor=  s     ||~rG   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   r*   r5   rN   s    rD   r   BaseDatabaseWrapper.commitB  s5     	$$&%%'$592rG   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   r*   r&   r4   rN   s    rD   r   BaseDatabaseWrapper.rollbackL  s>     	$$&%%'$#rG   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   r4   r)   r   r   r!   r&   rN   s    rD   r   BaseDatabaseWrapper.closeW  s     	$$&
 %%)@	'KKM##-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rc   )r   executer@   savepoint_create_sqlrC   sidr   s      rD   
_savepointBaseDatabaseWrapper._savepointm  2    [[]fNN488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rc   )r   r   r@   savepoint_rollback_sqlr   s      rD   _savepoint_rollback'BaseDatabaseWrapper._savepoint_rollbackq  s2    [[]fNN488::3?@ ]]r   c                     U R                  5        nUR                  U R                  R                  U5      5        S S S 5        g ! , (       d  f       g = frc   )r   r   r@   savepoint_commit_sqlr   s      rD   _savepoint_commit%BaseDatabaseWrapper._savepoint_commitu  r   r   c                 f    U R                   R                  =(       a    U R                  5       (       + $ rc   )r<   uses_savepointsget_autocommitrN   s    rD   _savepoint_allowed&BaseDatabaseWrapper._savepoint_allowedy  s#    }},,JT5H5H5J1JJrG   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   r1   r2   rz   replacer"   r   r   )rC   thread_identtidr   s       rD   	savepointBaseDatabaseWrapper.savepoint  s|     &&((((*,''R0!3 4 455$$&
rG   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   r4   )rC   r   sidsfuncrobusts        rD   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   )rC   r   s     rD   savepoint_commit$BaseDatabaseWrapper.savepoint_commit  s0    
 &&(($$&s#rG   c                     SU l         g)zI
Reset the counter used to generate unique savepoint ids in this thread.
r   N)r"   rN   s    rD   clean_savepoints$BaseDatabaseWrapper.clean_savepoints  s    
  !rG   c                     [        S5      e)zB
Backend-specific implementation to enable or disable autocommit.
zHsubclasses of BaseDatabaseWrapper may require a _set_autocommit() methodrp   )rC   r    s     rD   _set_autocommit#BaseDatabaseWrapper._set_autocommit  s     "V
 	
rG   c                 :    U R                  5         U R                  $ )zGet the autocommit state.)r   r    rN   s    rD   r   "BaseDatabaseWrapper.get_autocommit  s     rG   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    r5   run_and_clear_commit_hooks)rC   r    .force_begin_transaction_with_broken_autocommit"start_transaction_under_autocommits       rD   r   "BaseDatabaseWrapper.set_autocommit  s     	%%'))+  ; EECD 	+ .446  ,"41$$Z0 2$$DD++-9>D6 E:	 21s   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   r&   rN   s    rD   get_rollback BaseDatabaseWrapper.get_rollback  s)    ##,N  """rG   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  )rC   r   s     rD   set_rollback BaseDatabaseWrapper.set_rollback  s%     ##,N  'rG   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   rN   s    rD   r   ,BaseDatabaseWrapper.validate_no_atomic_block   s     ,E   rG   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.)r&   r   r'   rN   s    rD   validate_no_broken_transaction2BaseDatabaseWrapper.validate_no_broken_transaction  s.    ,G $$% rG   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)rC   disableds     rD   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.
FrR   rN   s    rD   r  /BaseDatabaseWrapper.disable_constraint_checking  s     rG   c                     g)zP
Backends can implement as needed to re-enable foreign key constraint
checking.
NrR   rN   s    rD   r  .BaseDatabaseWrapper.enable_constraint_checking$      
 	rG   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.
NrR   )rC   table_namess     rD   check_constraints%BaseDatabaseWrapper.check_constraints+  s     	rG   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() methodrp   rN   s    rD   	is_usableBaseDatabaseWrapper.is_usable5  s     "Q
 	
rG   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   r+   r,   r  r   rN   s    rD   r   0BaseDatabaseWrapper.close_if_health_check_failedB  sA     OO#,,%%~~JJL!%rG   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   r,   r   r   r   r*   r  r(   r   r   rN   s    rD   close_if_unusable_or_obsolete1BaseDatabaseWrapper.close_if_unusable_or_obsoleteO  s    
 ??&%*D" ""$(:(:<(HH

 ##>>##+0D(-1D*JJL}}(T^^-=-N

 .O(% 'rG   c                 n    U R                      U R                  S:  sS S S 5        $ ! , (       d  f       g = f)Nr   r/   r0   rN   s    rD   allow_thread_sharing(BaseDatabaseWrapper.allow_thread_sharingl  s%    &&--1 '&&s   &
4c                 z    U R                      U =R                  S-  sl        S S S 5        g ! , (       d  f       g = f)Nr   r&  rN   s    rD   inc_thread_sharing&BaseDatabaseWrapper.inc_thread_sharingq  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/   r0   RuntimeErrorrN   s    rD   dec_thread_sharing&BaseDatabaseWrapper.dec_thread_sharingu  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 ru   N)r'  r3   r1   r2   r   r   rN   s    rD   r   +BaseDatabaseWrapper.validate_thread_sharing}  s[     ))T-?-?7CTCTCV-V $(::t/A/A7CTCTCVX  .W)rG   c                     g)zf
Hook to do any database check or preparation, generally called before
migrating a project or an app.
NrR   rN   s    rD   prepare_database$BaseDatabaseWrapper.prepare_database  r  rG   c                     [        U 5      $ )zs
Context manager and decorator that re-throws backend-specific database
exceptions using Django's common wrappers.
)r   rN   s    rD   r   (BaseDatabaseWrapper.wrap_database_errors  s     $D))rG   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   rN   s    rD   chunked_cursor"BaseDatabaseWrapper.chunked_cursor  s    
 {{}rG   c                 .    [         R                  " X5      $ )z:Create a cursor that logs all queries in self.queries_log.)r
   CursorDebugWrapperrC   r   s     rD   r   %BaseDatabaseWrapper.make_debug_cursor  s    ''55rG   c                 .    [         R                  " X5      $ )z&Create a cursor without debug logging.)r
   CursorWrapperr<  s     rD   r   BaseDatabaseWrapper.make_cursor  s    ""600rG   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   )rC   
must_closer   s      rD   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   )rK   r   NO_DB_ALIASr   r   )rC   connr   s      rD   _nodb_cursor BaseDatabaseWrapper._nodb_cursor  sd      ~~B!3!3BVTB+~V	&  JJL  JJLs2   %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)SchemaEditorClassrq   )rC   argskwargss      rD   schema_editor!BaseDatabaseWrapper.schema_editor  s=     !!)%X  %%d<T<V<<rG   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!   r4   appendsetr#   r   r   	ExceptionloggererrorrL   )rC   r   r   es       rD   	on_commitBaseDatabaseWrapper.on_commit  s    ~~HII%%s4+=+='>&MN$$&&,M  F  ! LL():):(;;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   rR  z( in on_commit() during transaction (%s).TrS  )r   r4   poprY  rZ  r[  rL   )rC   current_run_on_commit_r   r   r\  s         rD   r   .BaseDatabaseWrapper.run_and_clear_commit_hooks  s    %%' $ 2 2#377:OAVF  $#
 ! LL():):(; <, -!%	 ! 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)r6   rW  r`  )rC   wrappers     rD   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)rC   r   r   s      rD   ri  BaseDatabaseWrapper.copy  s5     d&8&89=JJEDz-//rG   )r3   r0   r/   r   r$   r    r8   r(   r)   r%   r   r:   r*   r6   r<   r   r,   r+   r!   r>   r&   r@   r   r'   r5   r4   r#   r"   r   rB   rc   )F)Y__name__
__module__rL   __firstlineno____doc__
data_typesdata_types_suffixdata_type_check_constraintsr@   rM   r{   rL  r7   r9   r;   r=   r?   r   rA   r   r   rE   rO   rS   r   rY   r`   propertyre   rm   rr   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'  r*  r.  r   r3  r   r8  r   r   rC  rI  rO  r]  r   rf  ri  __static_attributes__rR   rG   rD   r   r      s   * J"$
CFLLNNI-M,< B6H
 F F, 	3 	3 9 9 & &
$

1
    4  	B0
2
/   : :     ' '*?A?K  ( 
 
" $ $ ! !
 JO#?J#'% 	2 	2
&: 2 2,," * *61     =2& 	( 	(	0rG   r   )+r1   ri  rX   loggingr-   r   ri   r[   collectionsr   
contextlibr   django.confr   django.core.exceptionsr   	django.dbr   r   r	   django.db.backendsr
   "django.db.backends.base.validationr   django.db.backends.signalsr   django.db.backends.utilsr   django.db.transactionr   django.db.utilsr   r   django.utils.asyncior   django.utils.functionalr   rG  rX  r   	getLoggerrZ  r   rR   rG   rD   <module>r     sq             %   7 H H $ E 9 6 < B - 3u 			4	5z0 z0rG   