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)Ú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Ú
connectionZis_in_memory_db)ÚselfÚskips© r   úG/tmp/pip-unpacked-wheel-lctamlir/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 )NZ	AutoFieldZBigIntegerFieldZ	CharField)ZBigAutoFieldZDurationFieldZGenericIPAddressFieldZ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   ZatomicÚaliasÚexecuter   )r   r%   r   r   r   Úsupports_json_field’   s    z$DatabaseFeatures.supports_json_fieldr(   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_insertr)   )3Ú__name__Ú
__module__Ú__qualname__Zminimum_database_versionZ#test_db_allows_multiple_connectionsZsupports_unspecified_pkZsupports_timezonesZ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_compoundZcan_defer_constraint_checksZsupports_over_clauseZ#supports_frame_range_fixed_distanceZ supports_aggregate_filter_clauseZ supports_order_by_nulls_modifierZ#requires_compound_order_by_subqueryZorder_by_nulls_firstZsupports_json_field_containsZsupports_update_conflictsZ%supports_update_conflicts_with_targetZtest_collationsZdjango_test_expected_failuresZ,create_test_table_with_composite_primary_keyr   r   r    r"   r(   ÚpropertyÚoperatorÚ
attrgetterZcan_introspect_json_fieldZhas_json_object_functionr)   Z can_return_rows_from_bulk_insertÚ__classcell__r   r   r#   r   r      sh   







ýý
D
	
	
ÿr   )r.   Z	django.dbr   Z django.db.backends.base.featuresr   Zdjango.db.utilsr   Zdjango.utils.functionalr   Úbaser   r   r   r   r   r   Ú<module>   s   