a
    ÛEbU  ã                   @   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+e"d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   sT   dhh d£dhh d£dœ}t jdk r4| ddhi¡ | j ¡ rP| d	d
dhi¡ |S )NzZmodel_fields.test_decimalfield.DecimalFieldTests.test_fetch_from_db_without_float_rounding>   z<schema.tests.SchemaTests.test_unique_no_unnecessary_fk_dropsz4schema.tests.SchemaTests.test_unique_and_reverse_m2mzKschema.tests.SchemaTests.test_rename_column_renames_deferred_sql_referenceszHschema.tests.SchemaTests.test_alter_field_default_doesnt_perform_querieszMmodel_fields.test_integerfield.PositiveIntegerFieldTests.test_negative_values>   zLdb_functions.math.test_round.RoundTests.test_integer_with_negative_precisionzIdb_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_precision)z6SQLite stores values rounded to 15 significant digits.z5SQLite naively remakes the table on field alteration.z!SQLite doesn't have a constraint.z6SQLite doesn't support negative precision for ROUND().)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_connectionszGservers.tests.LiveServerTestCloseConnectionTest.test_closes_connections)r   Úsqlite_version_infoÚupdateÚ
connectionZis_in_memory_db)ÚselfÚskips© r   úc/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/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_renamej   s    ÿþz2DatabaseFeatures.supports_atomic_references_renamec                    s   i 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#   t   s    ÿûz)DatabaseFeatures.introspected_field_typesc              	   C   sŒ   | j  ¡ �n}z<t | j j¡� | d¡ W d   ƒ n1 s<0    Y  W n  tyh   Y W d   ƒ dS 0 W d   ƒ n1 s~0    Y  dS )NzSELECT JSON('{"a": "b"}')FT)r   Úcursorr   ZatomicÚaliasÚexecuter   )r   r&   r   r   r   Úsupports_json_field~   s    ,2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+   )/Ú__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_functionr+   Z can_return_rows_from_bulk_insertÚ__classcell__r   r   r$   r   r      s^   






ý
4
		
	
ÿr   )r0   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   