https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/db/backends/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/db/backends/__init__.pyc
�
r�\c@s�ddlZddlZddlmZyddlmZWn!ek
r_ddlmZnXddl	m
Z
ddlmZddl
mZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZdefd��YZ defd��YZ!defd��YZ"e
dd�Z#defd��YZ$defd��YZ%defd��YZ&dS(i����N(t
DatabaseError(t_thread(t
_dummy_thread(t
namedtuple(tcontextmanager(tsettings(tDEFAULT_DB_ALIAS(tconnection_created(tutil(tTransactionManagementError(tDatabaseErrorWrapper(tcached_property(t
import_module(tsix(ttimezonetBaseDatabaseWrappercBs�eZdZd4ZdZeed�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"e#ed�Z$d�Z%d�Z&d �Z'd!�Z(d"�Z)d#�Z*d$�Z+d%�Z,d&�Z-d'�Z.d(�Z/e0d)��Z1d*�Z2d+�Z3d4d,�Z4d-�Z5d.�Z6d/�Z7e8d0��Z9d1�Z:e0d2��Z;d3�Z<RS(5s+
    Represents a database connection.
    tunknowncCs�d|_g|_||_||_d|_d|_t|_g|_	t|_
t|_g|_t
|_t|_d|_t|_t|_||_tj�|_dS(Ni(tNonet
connectiontqueriest
settings_dicttaliastuse_debug_cursortsavepoint_statetFalset
autocommitttransaction_statet_dirtytin_atomic_blockt
savepoint_idstTruetcommit_on_exittneeds_rollbacktclose_attclosed_in_transactionterrors_occurredtallow_thread_sharingtthreadt	get_identt
_thread_ident(tselfRRR$((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt__init__ s$																	cCs|j|jkS(N(R(R(tother((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt__eq__IscCs||kS(N((R(R*((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt__ne__LscCs
t|j�S(N(thashR(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt__hash__OscCs
t�dS(s=Returns a dict of parameters suitable for get_new_connection.N(tNotImplementedError(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytget_connection_paramsTscCs
t�dS(s#Opens a connection to the database.N(R/(R(tconn_params((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytget_new_connectionXscCs
t�dS(s-Initializes the database connection settings.N(R/(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytinit_connection_state\scCs
t�dS(s;Creates a cursor. Assumes that a connection is established.N(R/(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt
create_cursor`scCs�t|_g|_t|_|jd}|dkr:dn
tj�||_t|_t|_	|j
�}|j|�|_|j
�|jdr�|jt�ntjd|jd|�dS(s@Connects to the database. Assumes that the connection is closed.tCONN_MAX_AGEt
AUTOCOMMITtsenderRN(RRRR RRttimeR!R"R#R0R2RR3tset_autocommitRRtsendt	__class__(R(tmax_ageR1((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytconnectfs			
%		

cCs0|jdkr,|j�|j�WdQXndS(sN
        Guarantees that a connection to the database is established.
        N(RRtwrap_database_errorsR=(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytensure_connectionys
cCs(|j�|j�|j�SWdQXdS(N(R?R>R4(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt_cursor�s

cCs3|jdk	r/|j�|jj�SWdQXndS(N(RRR>tcommit(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt_commit�s
cCs3|jdk	r/|j�|jj�SWdQXndS(N(RRR>trollback(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt	_rollback�s
cCs3|jdk	r/|j�|jj�SWdQXndS(N(RRR>tclose(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt_close�s
cCs_|j�|js+|jdkrCtjrC|j|j��}ntj|j�|�}|S(sF
        Creates a cursor, opening a connection if necessary.
        N(	tvalidate_thread_sharingRRRtDEBUGtmake_debug_cursorR@Rt
CursorWrapper(R(tcursor((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRK�s
	cCs,|j�|j�|j�|j�dS(sB
        Commits a transaction and resets the dirty flag.
        N(RGtvalidate_no_atomic_blockRBt	set_clean(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRA�s


cCs,|j�|j�|j�|j�dS(sE
        Rolls back a transaction and resets the dirty flag.
        N(RGRLRDRM(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRC�s


cCsQ|j�z|j�Wd|jr9t|_t|_n	d|_X|j�dS(s8
        Closes the connection to the database.
        N(	RGRFRRR"R RRRM(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRE�s
		
cCs#|j�j|jj|��dS(N(RKtexecutetopstsavepoint_create_sql(R(tsid((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt
_savepoint�scCs#|j�j|jj|��dS(N(RKRNROtsavepoint_rollback_sql(R(RQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt_savepoint_rollback�scCs#|j�j|jj|��dS(N(RKRNROtsavepoint_commit_sql(R(RQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt_savepoint_commit�scCs|jjo|j�S(N(tfeaturestuses_savepointstget_autocommit(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt_savepoint_allowed�scCsq|j�sdStj�}t|�jdd�}|jd7_d||jf}|j�|j|�|S(s�
        Creates a savepoint inside the current transaction. Returns an
        identifier for the savepoint that will be used for the subsequent
        rollback or commit. Does nothing if savepoints are not supported.
        Nt-tiss%s_x%d(RZR%R&tstrtreplaceRRGRR(R(tthread_identttidRQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt	savepoint�s

cCs+|j�sdS|j�|j|�dS(sZ
        Rolls back to a savepoint. Does nothing if savepoints are not supported.
        N(RZRGRT(R(RQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytsavepoint_rollback�s
cCs+|j�sdS|j�|j|�dS(sU
        Releases a savepoint. Does nothing if savepoints are not supported.
        N(RZRGRV(R(RQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytsavepoint_commit�s
cCs
d|_dS(sZ
        Resets the counter used to generate unique savepoint ids in this thread.
        iN(R(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytclean_savepointsscCs
t�dS(sR
        Backend-specific implementation to enable or disable autocommit.
        N(R/(R(R((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt_set_autocommit
scCsr|j�|jj|�|rK|j�rK|rK|j�|j�n||j�krn|j|�ndS(s4
        Enters transaction management for a running thread. It must be balanced with
        the appropriate leave_transaction_management call, since the actual state is
        managed as a stack.

        The state and dirty flag are carried over from the surrounding block or
        from the settings, if there is no surrounding block (dirty is always false
        when no current block is running).

        If you switch off transaction management and there is a pending
        commit/rollback, the data will be commited, unless "forced" is True.
        N(RLRtappendtis_dirtyRARMRYR9(R(tmanagedtforced((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytenter_transaction_managements


cCs�|j�|jr |jd=ntd��|jrE|jd}n|jd}|jr�|j�||j�kr�|j|�ntd��n||j�kr�|j|�ndS(s�
        Leaves transaction management for a running thread. A dirty flag is carried
        over to the surrounding block, as a commit will commit all changes, even
        those from outside. (Commits are on connection level.)
        i����s,This code isn't under transaction managementR6s<Transaction managed block ended with pending COMMIT/ROLLBACKN(RLRR	RRRCRYR9(R(Rh((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytleave_transaction_management*s 
	
			
cCs|j�|jS(s-
        Check the autocommit state.
        (R?R(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRYGs
cCs.|j�|j�|j|�||_dS(s/
        Enable or disable autocommit.
        N(RLR?ReR(R(R((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR9Ns


cCs|jstd��n|jS(sK
        Get the "needs rollback" flag -- for *advanced use* only.
        s<The rollback flag doesn't work outside of an 'atomic' block.(RR	R (R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytget_rollbackWs	cCs%|jstd��n||_dS(sT
        Set or unset the "needs rollback" flag -- for *advanced use* only.
        s<The rollback flag doesn't work outside of an 'atomic' block.N(RR	R (R(RC((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytset_rollback`s	cCs|jrtd��ndS(s>
        Raise an error if an atomic block is active.
        s3This is forbidden when an 'atomic' block is active.N(RR	(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRLis	cCs|jrtd��ndS(NslAn error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.(R R	(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytvalidate_no_broken_transactionqs	cCs4|jr|j�nx|jr/|j�qWdS(sb
        Roll back any ongoing transaction and clean the transaction state
        stack.
        N(RRCRRk(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytabortws	
cCs|jS(sj
        Returns True if the current transaction requires a commit for changes to
        happen.
        (R(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRg�scCs|j�st|_ndS(s�
        Sets a dirty flag for the current thread and code streak. This can be used
        to decide in a managed block of code to decide whether there are open
        changes waiting for commit.
        N(RYRR(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt	set_dirty�scCst|_|j�dS(s�
        Resets a dirty flag for the current thread and code streak. This can be used
        to decide in a managed block of code to decide whether a commit or rollback
        should happen.
        N(RRRd(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRM�s	ccs0|j�}z	dVWd|r+|j�nXdS(sP
        Context manager that disables foreign key constraint checking.
        N(tdisable_constraint_checkingtenable_constraint_checking(R(tdisabled((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytconstraint_checks_disabled�s
	cCstS(s�
        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.
        (R(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRq�scCsdS(sh
        Backends can implement as needed to re-enable foreign key constraint
        checking.
        N((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRr�scCsdS(s�
        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.
        N((R(ttable_names((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytcheck_constraints�scCstd��dS(s
        Tests if the database connection is usable.

        This function 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.
        sCsubclasses of BaseDatabaseWrapper may require an is_usable() methodN(R/(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt	is_usable�s	cCs�|jdk	r�|j�|jdkr6|j�dS|jrh|j�rWt|_qh|j�dSn|jdk	r�t	j	�|jkr�|j�dSndS(s�
        Closes the current connection if unrecoverable errors have occurred,
        or if it outlived its maximum age.
        R6N(
RRRYRRER#RwRR!R8(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytclose_if_unusable_or_obsolete�s
	
$
cCsJ|jp|jtj�ksFtd|j|jtj�f��ndS(s7
        Validates 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 `allow_thread_sharing`
        property). Raises an exception if the validation fails.
        s�DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias '%s' was created in thread id %s and this is thread id %s.N(R$R'R%R&RR(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRG�s	cCs
t|�S(s�
        Context manager and decorator that re-throws backend-specific database
        exceptions using Django's common wrappers.
        (R
(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR>�scCstj||�S(sI
        Creates a cursor that logs all queries in self.queries.
        (RtCursorDebugWrapper(R(RK((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRI�sccsI|jdk}|j�}z	|VWd|j�|rD|j�nXdS(s9
        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.

        Provides a cursor: with self.temporary_connection() as cursor: ...
        N(RRRKRE(R(t
must_closeRK((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyttemporary_connections		
cCs
t�dS(sO
        Only required when autocommits_when_autocommit_is_off = True.
        N(R/(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt#_start_transaction_under_autocommitsN(=t__name__t
__module__t__doc__RROtvendorRRR)R+R,R.R0R2R3R4R=R?R@RBRDRFRKRARCRERRRTRVRZRaRbRcRdReRRjRkRYR9RlRmRLRnRoRgRpRMRRtRqRrRvRwRxRGRR>RIR{R|(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRsl(									
																
	
													
						
				tBaseDatabaseFeaturescBs+eZeZeZgZeZeZeZ	eZ
eZeZeZ
eZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZeZ eZ!eZ"eZ#eZ$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,eZ-d�Z.e/d��Z0e/d��Z1RS(cCs
||_dS(N(R(R(R((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR)�scCs�z�|jj�|jj�}|jd�|jj�|jd�|jj�|jd�|j�\}|jd�|jj�Wd|jj�X|dkS(s Confirm support for transactionss"CREATE TABLE ROLLBACK_TEST (X INT)s(INSERT INTO ROLLBACK_TEST (X) VALUES (8)s"SELECT COUNT(X) FROM ROLLBACK_TESTsDROP TABLE ROLLBACK_TESTNi(RRjRKRNRARCtfetchoneRk(R(RKtcount((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytsupports_transactions�s






cCsMdtfd��Y}y|jjj|��tSWntk
rHtSXdS(s6Confirm support for STDDEV and related stats functionst	StdDevPopcBseZdZRS(t
STDDEV_POP(R}R~tsql_function(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR��sN(tobjectRROtcheck_aggregate_supportRR/R(R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytsupports_stddev�s
(2R}R~Rtallows_group_by_pkRtneeds_datetime_string_casttempty_fetchmany_valuetupdate_can_self_selectt!interprets_empty_strings_as_nullst#ignores_nulls_in_unique_constraintstcan_use_chunked_readstcan_return_id_from_insertthas_bulk_insertRXt6can_combine_inserts_with_and_without_auto_increment_pktrelated_fields_match_typetallow_sliced_subqueriesthas_select_for_updatethas_select_for_update_nowaittsupports_select_relatedt#test_db_allows_multiple_connectionstsupports_unspecified_pktsupports_forward_referencest&requires_rollback_on_dirty_transactiontsupports_long_model_namesthas_real_datatypetsupports_subqueries_in_group_bytsupports_bitwise_ortsupports_microsecond_precisiontsupports_regex_backreferencingt!supports_date_lookup_using_stringtsupports_timezonesthas_zoneinfo_databaset-requires_explicit_null_ordering_when_groupingtsupports_1000_query_parameterstallows_primary_key_0tcan_defer_constraint_checkst(supports_mixed_date_datetime_comparisonstsupports_tablespacestsupports_sequence_resettcan_introspect_foreign_keystcan_distinct_on_fieldst"autocommits_when_autocommit_is_offtatomic_transactionstsupports_paramstyle_pyformattcan_rollback_ddlR)RR�R�(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR�sZ	tBaseDatabaseOperationscBseZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zed�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d �Z#d!�Z$d"�Z%d#�Z&d$�Z'd%�Z(ed&�Z)d'�Z*d(�Z+d)�Z,e-d*�Z.ed+�Z/d,�Z0e0Z1d-�Z2d.�Z3d/�Z4d0�Z5d1�Z6d2�Z7d3�Z8d4�Z9d5�Z:d6�Z;d7�Z<RS(8s�
    This class encapsulates all backend-specific differences, such as the way
    a backend performs ordering or calculates the ID of a recently-inserted
    row.
    sdjango.db.models.sql.compilercCs||_d|_dS(N(RRt_cache(R(R((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR)�s	cCsdS(s�
        Returns any SQL needed to support auto-incrementing primary keys, or
        None if no SQL is necessary.

        This SQL is executed when a table is created.
        N(R(R(ttabletcolumn((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytautoinc_sql�scCs
t|�S(s�
        Returns the maximum allowed batch size for the backend. The fields
        are the fields going to be inserted in the batch, the objs contains
        all the objects to be inserted.
        (tlen(R(tfieldstobjs((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytbulk_batch_size�scCsdS(s�
        Returns an SQL query that retrieves the first cache key greater than the
        n smallest.

        This is used by the 'db' cache backend to determine where to start
        culling.
        s>SELECT cache_key FROM %s ORDER BY cache_key LIMIT 1 OFFSET %%s((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytcache_key_culling_sql�scCs
t��dS(s�
        Given a lookup_type of 'year', 'month' or 'day', returns the SQL that
        extracts a value from the given date field field_name.
        N(R/(R(tlookup_typet
field_name((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdate_extract_sql�scCs
t��dS(sL
        Implements the date interval functionality for expressions
        N(R/(R(tsqlt	connectort	timedelta((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdate_interval_sql�scCs
t��dS(s�
        Given a lookup_type of 'year', 'month' or 'day', returns the SQL that
        truncates the given date field field_name to a date object with only
        the given specificity.
        N(R/(R(R�R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdate_trunc_sql�scCsdS(s�
        Returns the SQL necessary to cast a datetime value so that it will be
        retrieved as a Python datetime object instead of a string.

        This SQL should include a '%s' in place of the field's name.
        s%s((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdatetime_cast_sql�scCs
t��dS(s�
        Given a lookup_type of 'year', 'month', 'day', 'hour', 'minute' or
        'second', returns the SQL that extracts a value from the given
        datetime field field_name, and a tuple of parameters.
        N(R/(R(R�R�ttzname((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdatetime_extract_sql�scCs
t��dS(s

        Given a lookup_type of 'year', 'month', 'day', 'hour', 'minute' or
        'second', returns the SQL that truncates the given datetime field
        field_name to a datetime object with only the given specificity, and
        a tuple of parameters.
        N(R/(R(R�R�R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdatetime_trunc_sqlscCsdS(s~
        Returns the SQL necessary to make a constraint "initially deferred"
        during a CREATE TABLE statement.
        R\((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdeferrable_sql
scCs|rtd��ndSdS(s�
        Returns an SQL DISTINCT clause which removes duplicate rows from the
        result set. If any fields are given, only the given fields are being
        checked for duplicates.
        s<DISTINCT ON fields is not supported by this database backendtDISTINCTN(R/(R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdistinct_sqlscCsdS(sC
        Returns the SQL command that drops a foreign key.
        sDROP CONSTRAINT((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdrop_foreignkey_sqlscCsdS(s�
        Returns any SQL necessary to drop the sequence for the given table.
        Returns None if no SQL is necessary.
        N(R(R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdrop_sequence_sql%scCs|j�dS(s�
        Given a cursor object that has just performed an INSERT...RETURNING
        statement into a table that has an auto-incrementing ID, returns the
        newly created ID.
        i(R�(R(RK((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytfetch_returned_insert_id,scCsdS(s?
        Given a column type (e.g. 'BLOB', 'VARCHAR'), and an internal type
        (e.g. 'GenericIPAddressField'), returns the SQL necessary to cast it
        before using it in a WHERE statement. Note that the resulting string
        should contain a '%s' placeholder for the column being searched against.
        s%s((R(tdb_typet
internal_type((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytfield_cast_sql4scCsgS(s�
        Returns a list used in the "ORDER BY" clause to force no ordering at
        all. Returning an empty list means that nothing will be included in the
        ordering.
        ((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytforce_no_ordering=scCs|r
dSdSdS(sY
        Returns the FOR UPDATE SQL clause to lock rows for an update operation.
        sFOR UPDATE NOWAITs
FOR UPDATEN((R(tnowait((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytfor_update_sqlEscCstd��dS(s�
        Returns the SQL WHERE clause to use in order to perform a full-text
        search of the given field_name. Note that the resulting string should
        contain a '%s' placeholder for the value being searched against.
        s=Full-text search is not implemented for this database backendN(R/(R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytfulltext_search_sqlNscs�ddlm��fd��t|ttf�rSt�fd�|D��}n7|dkrhd}n"t�fd�|j�D��}tj	d�||fS(	s�
        Returns a string of the query last executed by the given cursor, with
        placeholders replaced with actual values.

        `sql` is the raw query containing placeholders, and `params` is the
        sequence of parameters. These are used by default, but this method
        exists for database backends to provide a better implementation
        according to their own quoting schemes.
        i����(t
force_textcs�|dtdd�S(Ntstrings_onlyterrorsR^(R(ts(R�(s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt<lambda>csc3s|]}�|�VqdS(N((t.0tval(t
to_unicode(s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pys	<genexpr>esc3s-|]#\}}�|��|�fVqdS(N((R�tktv(R�(s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pys	<genexpr>issQUERY = %r - PARAMS = %rN((
tdjango.utils.encodingR�t
isinstancetlistttupleRtdicttitemsR
t	text_type(R(RKR�tparamstu_params((R�R�s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytlast_executed_queryVs
	"cCs|jS(s

        Given a cursor object that has just performed an INSERT statement into
        a table that has an auto-incrementing ID, returns the newly created ID.

        This method also receives the table name and the name of the primary-key
        column.
        (t	lastrowid(R(RKt
table_nametpk_name((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytlast_insert_idmscCsdS(s�
        Returns the string to use in a query when performing lookups
        ("contains", "like", etc). The resulting string should contain a '%s'
        placeholder for the column being searched against.
        s%s((R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytlookup_castwscCsdS(s�
        Returns the maximum number of items that can be passed in a single 'IN'
        list condition, or None if the backend does not impose a limit.
        N(R(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytmax_in_list_sizescCsdS(sm
        Returns the maximum length of table and column names, or None if there
        is no limit.
        N(R(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytmax_name_length�scCs
t�dS(s�
        Returns the value to use for the LIMIT when we are wanting "LIMIT
        infinity". Returns None if the limit clause can be omitted in this case.
        N(R/(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytno_limit_value�scCsdS(s�
        Returns the value to use during an INSERT statement to specify that
        the field should use its default value.
        tDEFAULT((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytpk_default_value�scCs|S(s�
        Returns the value of a CLOB column, for backends that return a locator
        object that requires additional processing.
        ((R(tvalue((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytprocess_clob�scCsdS(s
        For backends that support returning the last insert ID as part
        of an insert query, this method returns the SQL and params to
        append to the INSERT query. The returned fragment should
        contain a format string to hold the appropriate column.
        N((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytreturn_insert_id�scCs4|jdkr$t|j�|_nt|j|�S(s�
        Returns the SQLCompiler class corresponding to the given name,
        in the namespace corresponding to the `compiler_module` attribute
        on this backend.
        N(R�RRtcompiler_moduletgetattr(R(t
compiler_name((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytcompiler�scCs
t��dS(s�
        Returns a quoted version of the given table, index or column name. Does
        not quote the given name if it's already been quoted.
        N(R/(R(tname((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt
quote_name�scCsdS(sH
        Returns an SQL expression that returns a random value.
        sRANDOM()((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytrandom_function_sql�scCs
t�dS(sn
        Returns the string to use in a query when performing regular expression
        lookups (using "regex" or "iregex"). The resulting string should
        contain a '%s' placeholder for the column being searched against.

        If the feature is not supported (or part of it is not supported), a
        NotImplementedError exception can be raised.
        N(R/(R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytregex_lookup�s	cCsd|j|�S(s�
        Returns the SQL for starting a new savepoint. Only required if the
        "uses_savepoints" feature is True. The "sid" parameter is a string
        for the savepoint id.
        sSAVEPOINT %s(R�(R(RQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRP�scCsd|j|�S(sE
        Returns the SQL for committing the given savepoint.
        sRELEASE SAVEPOINT %s(R�(R(RQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRU�scCsd|j|�S(sG
        Returns the SQL for rolling back the given savepoint.
        sROLLBACK TO SAVEPOINT %s(R�(R(RQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRS�scCsdS(s�
        Returns the SQL that will set the connection's time zone.

        Returns '' if the backend doesn't support time zones.
        R\((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytset_time_zone_sql�scCs
t��dS(s�
        Returns a list of SQL statements required to remove all data from
        the given database tables (without actually removing the tables
        themselves).

        The returned value also includes SQL statements required to reset DB
        sequences passed in :param sequences:.

        The `style` argument is a Style object as returned by either
        color_style() or no_style() in django.core.management.color.

        The `allow_cascade` argument determines whether truncation may cascade
        to tables with foreign keys pointing the tables being truncated.
        PostgreSQL requires a cascade even if these tables are empty.
        N(R/(R(tstylettablest	sequencest
allow_cascade((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt	sql_flush�scCsgS(s
        Returns a list of the SQL statements required to reset sequences
        passed in :param sequences:.

        The `style` argument is a Style object as returned by either
        color_style() or no_style() in django.core.management.color.
        ((R(RR((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytsequence_reset_by_name_sql�scCsgS(s�
        Returns a list of the SQL statements required to reset sequences for
        the given models.

        The `style` argument is a Style object as returned by either
        color_style() or no_style() in django.core.management.color.
        ((R(Rt
model_list((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytsequence_reset_sqlscCsdS(sL
        Returns the SQL statement required to start a transaction.
        sBEGIN;((R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytstart_transaction_sqlscCs|s
dSdS(sJ
        Returns the SQL statement required to end a transaction.
        s	ROLLBACK;sCOMMIT;((R(tsuccess((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytend_transaction_sqlscCsdS(s(
        Returns the SQL that will be used in a query to define the tablespace.

        Returns '' if the backend doesn't support tablespaces.

        If inline is True, the SQL is appended to a row; otherwise it's appended
        to the entire CREATE TABLE or CREATE INDEX statement.
        R\((R(t
tablespacetinline((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyttablespace_sqls	cCs>ddlm}||�jdd�jdd�jdd�S(	s)Prepares a value for use in a LIKE query.i����(R�s\s\\t%s\%t_s\_(R�R�R^(R(txR�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytprep_for_like_query(scCs|S(s�
        Certain backends do not accept some values for "serial" fields
        (for example zero in MySQL). This method will raise a ValueError
        if the value is invalid, otherwise returns validated value.
        ((R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytvalidate_autopk_value1scCs|dkrdStj|�S(s�
        Transform a date value to an object compatible with what is expected
        by the backend driver for date columns.
        N(RR
R�(R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytvalue_to_db_date9scCs|dkrdStj|�S(s�
        Transform a datetime value to an object compatible with what is expected
        by the backend driver for datetime columns.
        N(RR
R�(R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytvalue_to_db_datetimeBscCs;|dkrdStj|�r.td��ntj|�S(s�
        Transform a time value to an object compatible with what is expected
        by the backend driver for time columns.
        s-Django does not support timezone-aware times.N(RRtis_awaret
ValueErrorR
R�(R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytvalue_to_db_timeKs
cCs#|dkrdStj|||�S(s�
        Transform a decimal.Decimal value to an object compatible with what is
        expected by the backend driver for decimal (numeric) columns.
        N(RRt
format_number(R(R�t
max_digitstdecimal_places((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytvalue_to_db_decimalVscCs4tj|dd�}tj|dd�}||gS(s�
        Returns a two-elements list with the lower and upper bound to be used
        with a BETWEEN operator to query a DateField value using a year
        lookup.

        `value` is an int, containing the looked-up year.
        iii(tdatetimetdate(R(R�tfirsttsecond((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt!year_lookup_bounds_for_date_field_scCs|tj|dd�}tj|dddddd�}tjrrtj�}tj||�}tj||�}n||gS(s�
        Returns a two-elements list with the lower and upper bound to be used
        with a BETWEEN operator to query a DateTimeField value using a year
        lookup.

        `value` is an int, containing the looked-up year.
        iiiii;i?B(RRtUSE_TZRtget_current_timezonet
make_aware(R(R�RR ttz((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt%year_lookup_bounds_for_datetime_fieldks!	cCsm|dks|dkr|S|j�}|dkr>t|�S|ri|jd�s_|dkrit|�S|S(s�
        Coerce the value returned by the database backend into a consistent type
        that is compatible with the field type.
        t
FloatFieldtIntegerFieldt	AutoFieldN(Rtget_internal_typetfloattendswithtint(R(R�tfieldR�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytconvert_values{s

cCsdS(s1Check that the backend supports the provided aggregate

        This is used on specific backends to rule out known aggregates
        that are known to have faulty implementations. If the named
        aggregate function has a known problem, the backend should
        raise NotImplementedError.
        N((R(taggregate_func((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR��scCsd|}|j|�S(sCombine a list of subexpressions into a single expression, using
        the provided connecting operator. This is required because operators
        can vary between backends (e.g., Oracle with %% and &) and between
        subexpression types (e.g., date expressions)
        s %s (tjoin(R(R�tsub_expressionstconn((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytcombine_expression�s
cCs|S(sjAllow modification of insert parameters. Needed for Oracle Spatial
        backend due to #10888.
        ((R(tplaceholdersR�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytmodify_insert_params�s(=R}R~RR�R)R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RPRURSRRRRR	RRRRtprep_for_iexact_queryRRRRRR!R&R/R�R4R6(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR��sr					
																				
									
								
	
														
		t	FieldInfosAname type_code display_size internal_size precision scale null_oktBaseDatabaseIntrospectioncBs}eZdZiZd�Zd�Zd�Zdd�Zd�Z	e
d�Zd�Zd�Z
d	�Zd
�Zd�ZRS(
sN
    This class encapsulates all backend-specific introspection utilities
    cCs
||_dS(N(R(R(R((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR)�scCs|j|S(sHook for a database backend to use the cursor description to
        match a Django field type to a database column.

        For Oracle, the column data_type on its own is insufficient to
        distinguish between a FloatField and IntegerField, for example.(tdata_types_reverse(R(t	data_typetdescription((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytget_field_type�scCs|S(s�Apply a conversion to the name for the purposes of comparison.

        The default table name converter is for case sensitive comparison.
        ((R(R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyttable_name_converter�scCs1|dkr|jj�}nt|j|��S(s
        Returns a list of names of all tables that exist in the database.
        The returned table list is sorted by Python's default sorting. We
        do NOT use database's ORDER BY here to avoid subtle differences
        in sorting order between databases.
        N(RRRKtsortedtget_table_list(R(RK((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRu�scCs
t�dS(se
        Returns an unsorted list of names of all tables that exist in the
        database.
        N(R/(R(RK((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR@�sc
Csddlm}m}t�}x�|j�D]�}x�|j|�D]u}|jjsZqBn|j|j	j
|�sxqBn|j|jj�|j
g|jjD]}|j�^q��qBWq,Wt|�}|r|j�}g|D]!}	|j|	�|kr�|	^q�}n|S(s�
        Returns a list of all table names that have associated Django models and
        are in INSTALLED_APPS.

        If only_existing is True, the resulting list will only include the tables
        that actually exist in the database.
        i����(tmodelstrouter(t	django.dbRARBtsettget_appst
get_modelst_metaRhtallow_syncdbRRtaddtdb_tabletupdatetlocal_many_to_manytm2m_db_tableR�RuR>(
R(t
only_existingRARBRtapptmodeltftexisting_tablestt((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytdjango_table_names�s"	4
$cCs�ddlm}m}g}xV|j�D]H}x?|j|�D].}|j|jj|�r?|j|�q?q?Wq)Wt	t
|j|��}tg|D]'}|j|j
j�|kr�|^q��S(sLReturns a set of all models represented by the provided list of table names.i����(RARB(RCRARBRERFRHRRRfR�tmapR>RDRGRJ(R(RRARBt
all_modelsRORPtm((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytinstalled_models�s
cCs7ddlm}m}|j�}g}x|D]}x�|j|�D]�}|jjs]qEn|jjroqEn|j|j	j
|�s�qEnxN|jjD]@}t||j
�r�|ji|jjd6|jd6�Pq�q�WxJ|jjD]<}|jjdkr�|ji|j�d6dd6�q�q�WqEWq/W|S(sPReturns a list of information about all DB sequences for all models in all apps.i����(RARBR�R�N(RCRARBRERFRGRhtswappedRHRRtlocal_fieldsR�R)RfRJR�RLtreltthroughRRM(R(RARBtappst
sequence_listRORPRQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR^�s&
$0cCs
t�dS(s�
        Backends can override this to return a list of (column_name, referenced_table_name,
        referenced_column_name) for all key columns in given table.
        N(R/(R(RKR�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytget_key_columnsscCs@x9tj|j||��D]}|ddr|dSqWdS(sQ
        Returns the name of the primary key column for the given table.
        itprimary_keyiN(R
t	iteritemstget_indexesR(R(RKR�R�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytget_primary_key_column s"cCs
t�dS(sX
        Returns a dictionary of indexed fieldname -> infodict for the given
        table, where each infodict is in the format:
            {'primary_key': boolean representing whether it's the primary key,
             'unique': boolean representing whether it's a unique index}

        Only single-column indexes are introspected.
        N(R/(R(RKR�((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRb)s	N(R}R~RR:R)R=R>RRuR@RRTRXR^R_RcRb(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR9�s									tBaseDatabaseClientcBs&eZdZdZd�Zd�ZRS(s^
    This class encapsulates all backend-specific methods for opening a
    client shell.
    cCs
||_dS(N(R(R(R((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR)>scCs
t��dS(N(R/(R(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytrunshellBsN(R}R~RRtexecutable_nameR)Re(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRd5s	tBaseDatabaseValidationcBs eZdZd�Zd�ZRS(sH
    This class encapsualtes all backend-specific model validation.
    cCs
||_dS(N(R(R(R((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyR)JscCsdS(s3By default, there is no backend-specific validationN((R(R�toptsRQ((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pytvalidate_fieldMs(R}R~RR)Ri(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyRgFs	('RR8tdjango.db.utilsRtdjango.utils.six.movesRR%tImportErrorRtcollectionsRt
contextlibRtdjango.confRRCRtdjango.db.backends.signalsRtdjango.db.backendsRtdjango.db.transactionR	R
tdjango.utils.functionalRtdjango.utils.importlibRtdjango.utilsR
RR�RR�R�R8R9RdRg(((s=/tmp/pip-install-XxeQeY/django/django/db/backends/__init__.pyt<module>s:
�����	�

https://t.me/AnonymousX5 - 2025