o
    ˷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                       sB  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dZejdk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"ejdkZ#e#Z$ddddZ%dh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Z0e'dd Z1e,e-.dZ2  Z3S )DatabaseFeatures)   	   FTi  r	   )r	      r   )r	   #      )r	      r   )r	      r   )r	      r   )r	      r   )r	   r   r   )r	      r   nocasebinary)cicsnon_defaultz9expressions.tests.FTimeDeltaTests.test_mixed_comparisons1c                 C   sP   dhh dh dd}t jdk r|ddhi | j r&|dd	d
hi |S )NzZmodel_fields.test_decimalfield.DecimalFieldTests.test_fetch_from_db_without_float_rounding>   4schema.tests.SchemaTests.test_unique_and_reverse_m2m<schema.tests.SchemaTests.test_unique_no_unnecessary_fk_dropsHschema.tests.SchemaTests.test_alter_field_default_doesnt_perform_queriesKschema.tests.SchemaTests.test_rename_column_renames_deferred_sql_references>   Idb_functions.math.test_round.RoundTests.test_null_with_negative_precisionJdb_functions.math.test_round.RoundTests.test_float_with_negative_precisionLdb_functions.math.test_round.RoundTests.test_decimal_with_negative_precisionLdb_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_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
connectionis_in_memory_db)selfskips r'   Z/var/www/ideatree/venv/lib/python3.10/site-packages/django/db/backends/sqlite3/features.pydjango_test_skips;   s*   

z"DatabaseFeatures.django_test_skipsc                 C   
   t jdkS )N)r	      r   r   r!   r%   r'   r'   r(   !supports_atomic_references_renamel      
z2DatabaseFeatures.supports_atomic_references_renamec                    s   i t  jdddddS )N	AutoFieldBigIntegerField	CharField)BigAutoFieldDurationFieldGenericIPAddressFieldSmallAutoField)superintrospected_field_typesr-   	__class__r'   r(   r8   p   s   z)DatabaseFeatures.introspected_field_typesc              	   C   s   | j  8}zt| j j |d W d    n1 sw   Y  W n ty4   Y W d    dS w W d    dS 1 s@w   Y  dS )NzSELECT JSON('{"a": "b"}')FT)r#   cursorr   atomicaliasexecuter   )r%   r;   r'   r'   r(   supports_json_fieldz   s   
z$DatabaseFeatures.supports_json_fieldr?   c                 C   r*   )N)r	   r   r,   r-   r'   r'   r(   can_return_columns_from_insert   r/   z/DatabaseFeatures.can_return_columns_from_insertr@   )4__name__
__module____qualname__minimum_database_version#test_db_allows_multiple_connectionssupports_unspecified_pksupports_timezonesmax_query_paramssupports_transactionsatomic_transactionscan_rollback_ddlcan_create_inline_fksupports_paramstyle_pyformatrequires_literal_defaultscan_clone_databasessupports_temporal_subtractionignores_table_name_casesupports_cast_with_precisiontime_cast_precisioncan_release_savepointshas_case_insensitive_liker   r!   can_alter_table_rename_columncan_alter_table_drop_column supports_parentheses_in_compound!supports_pragma_foreign_key_checkcan_defer_constraint_checks%supports_functions_in_partial_indexessupports_over_clause#supports_frame_range_fixed_distance supports_aggregate_filter_clause supports_order_by_nulls_modifierorder_by_nulls_firstsupports_json_field_containssupports_update_conflicts%supports_update_conflicts_with_targettest_collationsdjango_test_expected_failuresr   r)   r.   r8   r?   propertyoperator
attrgettercan_introspect_json_fieldhas_json_object_functionr@    can_return_rows_from_bulk_insert__classcell__r'   r'   r9   r(   r      sl    









0
	
	
r   )rg   	django.dbr    django.db.backends.base.featuresr   django.db.utilsr   django.utils.functionalr   baser   r   r'   r'   r'   r(   <module>   s    