U
    }®cÏ  ã                   @   s`   d dl Z 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                       s  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dZejdkZe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 ddd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+‡  Z,S )ÚDatabaseFeaturesTFiç  é   )r	   é   r   )r	   é   r   )r	   é   r   ©r	   é   r   )r	   é   r   )r	   r   r   ZnocaseÚbinary)ÚciÚcsZnon_defaultc                 C   sP   dhddddhdhdœ}t jdk r2| d	d
hi¡ | j ¡ rL| ddhi¡ |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_referenceszMmodel_fields.test_integerfield.PositiveIntegerFieldTests.test_negative_values)z6SQLite stores values rounded to 15 significant digits.z5SQLite naively remakes the table on field alteration.z!SQLite doesn't have a constraint.)r	   é   z*Nondeterministic failure on SQLite < 3.27.zIexpressions_window.tests.WindowFunctionTests.test_subquery_row_range_rankzOthe sqlite backend's close() method is a no-op when using an in-memory databasezJservers.test_liveserverthread.LiveServerThreadTest.test_closes_connections)r   Úsqlite_version_infoÚupdateÚ
connectionZis_in_memory_db)ÚselfÚskips© r   úG/tmp/pip-unpacked-wheel-7m9rsep5/django/db/backends/sqlite3/features.pyÚdjango_test_skips5   s.    ÿüÿö
ÿÿ
ÿþz"DatabaseFeatures.django_test_skipsc                 C   s*   t  ¡ d  d¡r tjdkr dS tjdkS )Nr   z10.15.r   F)r	   é   r   )ÚplatformÚmac_verÚ
startswithr   r   ©r   r   r   r   Ú!supports_atomic_references_renameT   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_fieldf   s    z$DatabaseFeatures.supports_json_fieldr)   )-Ú__name__Ú
__module__Ú__qualname__Zcan_use_chunked_readsZ#test_db_allows_multiple_connectionsZsupports_unspecified_pkZsupports_timezonesZmax_query_paramsZ(supports_mixed_date_datetime_comparisonsZsupports_transactionsZatomic_transactionsZcan_rollback_ddlZcan_create_inline_fkZsupports_paramstyle_pyformatZcan_clone_databasesZsupports_temporal_subtractionZignores_table_name_caseZsupports_cast_with_precisionZtime_cast_precisionZcan_release_savepointsr   r   Zcan_alter_table_rename_columnZ supports_parentheses_in_compoundZ!supports_pragma_foreign_key_checkZcan_defer_constraint_checksZ%supports_functions_in_partial_indexesZsupports_over_clauseZ#supports_frame_range_fixed_distanceZ supports_aggregate_filter_clauseZ supports_order_by_nulls_modifierZorder_by_nulls_firstZsupports_json_field_containsZtest_collationsr   r   r!   r#   r)   ÚpropertyÚoperatorÚ
attrgetterZcan_introspect_json_fieldZhas_json_object_functionÚ__classcell__r   r   r$   r   r      sT   






ý

	
	r   )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   