B
    ©0H[�*  ã               @   s6   d dl mZ d dlmZ d dlmZ G dd„ dƒZdS )é    )ÚStdDev)ÚProgrammingError)Úcached_propertyc               @   s–  e Zd ZdZdZdZg ZdZdZdZ	dZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCdZDeEZFdZGdZHdZIdZJdZKdZLdZMdZNdZOdZPdZQdZRdZSdZTdZUdZVdZWdZXdZYdZZdZ[dd„ Z\e]dd„ ƒZ^e]d	d
„ ƒZ_ddd„Z`dS )ÚBaseDatabaseFeaturesFTNÚ c             C   s
   || _ d S )N)Ú
connection)Úselfr   © r	   údC:\Users\HIRONO~1\AppData\Local\Temp\pip-install-6bm3nxem\django\django\db\backends\base\features.pyÚ__init__   s    zBaseDatabaseFeatures.__init__c          	   C   sr   | j  ¡ �Z}| d¡ | j  d¡ | d¡ | j  ¡  | j  d¡ | d¡ | ¡ \}| d¡ W dQ R X |dkS )	z!Confirm support for transactions.z"CREATE TABLE ROLLBACK_TEST (X INT)Fz(INSERT INTO ROLLBACK_TEST (X) VALUES (8)Tz"SELECT COUNT(X) FROM ROLLBACK_TESTzDROP TABLE ROLLBACK_TESTNr   )r   ÚcursorÚexecuteZset_autocommitÚrollbackZfetchone)r   r   Úcountr	   r	   r
   Úsupports_transactions  s    




z*BaseDatabaseFeatures.supports_transactionsc             C   s0   y| j j tdƒ¡ dS  tk
r*   dS X dS )z7Confirm support for STDDEV and related stats functions.é   TFN)r   ÚopsZcheck_expression_supportr   ÚNotImplementedError)r   r	   r	   r
   Úsupports_stddev  s
    z$BaseDatabaseFeatures.supports_stddevc             C   s   | j r|r|jrdS dS )a{  
        What is the type returned when the backend introspects a BooleanField?
        The `field` argument may be used to give further details of the field
        to be introspected.

        The return value from this function is compared by tests against actual
        introspection results; it should provide expectations, not run an
        introspection itself.
        ZNullBooleanFieldZBooleanField)Úcan_introspect_nullÚnull)r   Úfieldr	   r	   r
   Úintrospected_boolean_field_type  s    
z4BaseDatabaseFeatures.introspected_boolean_field_type)N)aÚ__name__Ú
__module__Ú__qualname__Zgis_enabledZallows_group_by_pkZallows_group_by_selected_pksZempty_fetchmany_valueZupdate_can_self_selectZ!interprets_empty_strings_as_nullsZ$supports_nullable_unique_constraintsZ.supports_partially_nullable_unique_constraintsZcan_use_chunked_readsZcan_return_id_from_insertZcan_return_ids_from_bulk_insertZhas_bulk_insertZuses_savepointsZcan_release_savepointsZrelated_fields_match_typeZallow_sliced_subqueriesZhas_select_for_updateZhas_select_for_update_nowaitZ!has_select_for_update_skip_lockedZhas_select_for_update_ofZselect_for_update_of_columnZ#test_db_allows_multiple_connectionsZsupports_unspecified_pkZsupports_forward_referencesZtruncates_namesZhas_real_datatypeZsupports_subqueries_in_group_byZhas_native_uuid_fieldZhas_native_duration_fieldZsupports_temporal_subtractionZsupports_microsecond_precisionZsupports_regex_backreferencingZ!supports_date_lookup_using_stringZsupports_timezonesZhas_zoneinfo_databaseZ-requires_explicit_null_ordering_when_groupingZnulls_order_largestZmax_query_paramsZallows_auto_pk_0Zcan_defer_constraint_checksZ(supports_mixed_date_datetime_comparisonsZsupports_tablespacesZsupports_sequence_resetr   Zcan_introspect_defaultZcan_introspect_foreign_keysZcan_introspect_autofieldZ can_introspect_big_integer_fieldZcan_introspect_binary_fieldZcan_introspect_decimal_fieldZcan_introspect_ip_address_fieldZ%can_introspect_positive_integer_fieldZ"can_introspect_small_integer_fieldZcan_introspect_time_fieldZsupports_index_column_orderingZcan_distinct_on_fieldsZ"autocommits_when_autocommit_is_offZatomic_transactionsZcan_rollback_ddlZ!supports_atomic_references_renameZsupports_combined_altersZsupports_foreign_keysZ!supports_column_check_constraintsZsupports_paramstyle_pyformatZrequires_literal_defaultsZconnection_persists_old_columnsr   Zclosed_cursor_error_classZhas_case_insensitive_likeZrequires_sqlparse_for_splittingZbare_select_suffixZimplied_column_nullZuppercases_column_namesZ%supports_select_for_update_with_limitZgreatest_least_ignores_nullsZcan_clone_databasesZignores_table_name_caseZfor_update_after_fromZsupports_select_unionZsupports_select_intersectionZsupports_select_differenceZ%supports_slicing_ordering_in_compoundZ supports_aggregate_filter_clauseZsupports_index_on_text_fieldZsupports_over_clauseZsupports_cast_with_precisionZ(create_test_procedure_without_params_sqlZ(create_test_procedure_with_int_param_sqlZsupports_callproc_kwargsr   r   r   r   r   r	   r	   r	   r
   r      s¸   	r   N)Zdjango.db.models.aggregatesr   Zdjango.db.utilsr   Zdjango.utils.functionalr   r   r	   r	   r	   r
   Ú<module>   s   