U
    ^|e                     @   sX   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ ddl	m
Z
 G dd	 d	eZdS )
    N)transaction)BaseDatabaseFeatures)OperationalError)cached_property   )Databasec                       s8  e 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ejdkZejdkZdZdZejdkZejdkZejd	kZejd
kZejdk ZdZdZ ejdkZ!e!Z"ddddZ#dhZ$dZ%e&dd Z'e&dd Z(e& fddZ)e&dd Z*e+e,-dZ.e+e,-dZ/e&dd Z0e+e,-dZ1  Z2S )DatabaseFeatures)      FTi  r	   )r	      r   )r	   #      )r	      r   )r	      r   )r	   r   r   )r	   r   )r	      r   Znocasebinary)ZcicsZnon_defaultz9expressions.tests.FTimeDeltaTests.test_mixed_comparisons1z
        CREATE TABLE test_table_composite_pk (
            column_1 INTEGER NOT NULL,
            column_2 INTEGER NOT NULL,
            PRIMARY KEY(column_1, column_2)
        )
    c                 C   sr   dhddddhdddd	hd
}t jdk r8|ddhi | j rZ|ddhdhd n|dhdhd |S )NzZmodel_fields.test_decimalfield.DecimalFieldTests.test_fetch_from_db_without_float_roundingz<schema.tests.SchemaTests.test_unique_no_unnecessary_fk_dropsz4schema.tests.SchemaTests.test_unique_and_reverse_m2mzHschema.tests.SchemaTests.test_alter_field_default_doesnt_perform_querieszKschema.tests.SchemaTests.test_rename_column_renames_deferred_sql_referenceszIdb_functions.math.test_round.RoundTests.test_null_with_negative_precisionzLdb_functions.math.test_round.RoundTests.test_decimal_with_negative_precisionzJdb_functions.math.test_round.RoundTests.test_float_with_negative_precisionzLdb_functions.math.test_round.RoundTests.test_integer_with_negative_precision)z6SQLite stores values rounded to 15 significant digits.z5SQLite naively remakes the table on field alteration.z6SQLite doesn't support negative precision for ROUND().)r	      z*Nondeterministic failure on SQLite < 3.27.zIexpressions_window.tests.WindowFunctionTests.test_subquery_row_range_rankzJservers.test_liveserverthread.LiveServerThreadTest.test_closes_connectionszGservers.tests.LiveServerTestCloseConnectionTest.test_closes_connectionszbtest_utils.tests.AssertNumQueriesUponConnectionTests.test_ignores_connection_configuration_queries)zOthe sqlite backend's close() method is a no-op when using an in-memory databasezHFor SQLite in-memory tests, closing the connection destroysthe database.zMservers.tests.LiveServerInMemoryDatabaseLockTest.test_in_memory_database_lockz`backends.sqlite.test_creation.TestDbSignatureTests.test_get_test_db_clone_settings_not_supported)zOOnly connections to in-memory SQLite databases are passed to the server thread.zMmultiprocessing's start method is checked only for in-memory SQLite databases)r   sqlite_version_infoupdate
connectionis_in_memory_db)selfskips r   `/var/www/website-v5/atlas_env/lib/python3.8/site-packages/django/db/backends/sqlite3/features.pydjango_test_skips?   sJ    	

z"DatabaseFeatures.django_test_skipsc                 C   s
   t jdkS )N)r	      r   r   r   r   r   r   r   !supports_atomic_references_rename   s    z2DatabaseFeatures.supports_atomic_references_renamec                    s   t  jdddddS )N	AutoFieldBigIntegerField	CharField)BigAutoFieldDurationFieldGenericIPAddressFieldSmallAutoField)superintrospected_field_typesr   	__class__r   r   r)      s    z)DatabaseFeatures.introspected_field_typesc              
   C   sd   | j  P}z(t| j j |d W 5 Q R X W n  tk
rT   Y W 5 Q R  dS X W 5 Q R X dS )NzSELECT JSON('{"a": "b"}')FT)r   cursorr   atomicaliasexecuter   )r   r,   r   r   r   supports_json_field   s    z$DatabaseFeatures.supports_json_fieldr0   c                 C   s
   t jdkS )N)r	   r   r   r   r   r   r   can_return_columns_from_insert   s    z/DatabaseFeatures.can_return_columns_from_insertr1   )3__name__
__module____qualname__minimum_database_versionZ#test_db_allows_multiple_connectionsZsupports_unspecified_pkZsupports_timezonesmax_query_paramsZsupports_transactionsZatomic_transactionsZcan_rollback_ddlZcan_create_inline_fkZrequires_literal_defaultsZcan_clone_databasesZsupports_temporal_subtractionZignores_table_name_caseZsupports_cast_with_precisionZtime_cast_precisionZcan_release_savepointsZhas_case_insensitive_liker   r   Zcan_alter_table_rename_columnZcan_alter_table_drop_columnZ supports_parentheses_in_compoundcan_defer_constraint_checkssupports_over_clauseZ#supports_frame_range_fixed_distance supports_aggregate_filter_clause supports_order_by_nulls_modifierZ#requires_compound_order_by_subqueryorder_by_nulls_firstsupports_json_field_containssupports_update_conflicts%supports_update_conflicts_with_targetZtest_collationsdjango_test_expected_failuresZ,create_test_table_with_composite_primary_keyr   r   r    r)   r0   propertyoperator
attrgetterZcan_introspect_json_fieldhas_json_object_functionr1    can_return_rows_from_bulk_insert__classcell__r   r   r*   r   r      sh   








D
	
	
r   )rA   	django.dbr   Z django.db.backends.base.featuresr   django.db.utilsr   django.utils.functionalr   baser   r   r   r   r   r   <module>   s   