o
    øÇ[hJ>  ã                   @   s*   d dl mZ d dlmZ G dd„ dƒZdS )é    )ÚProgrammingError)Úcached_propertyc                   @   sŒ  e Zd ZdZdZdZdZdZg 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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.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dddddd	d
dddddddddœZ7dZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCdZDdZEdZFdZGdZHdZIdZJdZKeLZMdZNdZOdZPdZQdZRdZSdZTdZUdZVdZWdZXdZYdZZdZ[dZ\dZ]dZ^dZ_dZ`dZadZbdZcdZddZedZfegƒ ZhdZidZjdZkdZldZmdZndZodZpdZqdZrdZsdZtdZudZvdZwdZxdZydZzdZ{dZ|dZ}dZ~dZdZ€dZdZ‚dZƒdZ„dZ…dZ†dZ‡dZˆddddddœZ‰dZŠdZ‹dZŒegƒ Zi ZŽdd„ Zedd„ ƒZ‘edd„ ƒZ’dd„ Z“dS )ÚBaseDatabaseFeaturesNFTÚ	AutoFieldÚBigAutoFieldÚBigIntegerFieldÚBinaryFieldÚBooleanFieldÚ	CharFieldÚDurationFieldÚGenericIPAddressFieldÚIntegerFieldÚPositiveBigIntegerFieldÚPositiveIntegerFieldÚPositiveSmallIntegerFieldÚSmallAutoFieldÚSmallIntegerFieldÚ	TimeField)r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   Ú é   )ÚciÚcsZnon_defaultZ
swedish_ciZvirtualc                 C   s
   || _ d S )N)Ú
connection)Úselfr   © r   ú‡/home/ubuntu/experiments/live_experiments/Pythonexperiments/Otree/venv/lib/python3.10/site-packages/django/db/backends/base/features.pyÚ__init__Š  s   
zBaseDatabaseFeatures.__init__c                 C   s   | j jjduS )z5Does this backend support explaining query execution?N)r   ÚopsZexplain_prefix)r   r   r   r   Ú#supports_explaining_query_execution  s   z8BaseDatabaseFeatures.supports_explaining_query_executionc                 C   sŒ   | j  ¡ 5}| d¡ | j  d¡ | d¡ | j  ¡  | j  d¡ | d¡ | ¡ \}| d¡ W d  ƒ |dkS 1 s=w   Y  |dkS )	z!Confirm support for transactions.z"CREATE TABLE ROLLBACK_TEST (X INT)Fz(INSERT INTO ROLLBACK_TEST (X) VALUES (8)Tz"SELECT COUNT(X) FROM ROLLBACK_TESTzDROP TABLE ROLLBACK_TESTNr   )r   ÚcursorÚexecuteZset_autocommitÚrollbackZfetchone)r   r   Úcountr   r   r   Úsupports_transactions’  s   





ø	÷	z*BaseDatabaseFeatures.supports_transactionsc                 C   s   | j sdS |jjS )NF)Úallows_group_by_selected_pksÚ_metaZmanaged)r   Úmodelr   r   r   Ú%allows_group_by_selected_pks_on_model   s   z:BaseDatabaseFeatures.allows_group_by_selected_pks_on_model)”Ú__name__Ú
__module__Ú__qualname__Zminimum_database_versionZgis_enabledZallows_group_by_lobr$   Zallows_group_by_select_indexZempty_fetchmany_valueZupdate_can_self_selectZ"delete_can_self_reference_subqueryZ!interprets_empty_strings_as_nullsZ$supports_nullable_unique_constraintsZ.supports_partially_nullable_unique_constraintsZ*supports_nulls_distinct_unique_constraintsZ&supports_deferrable_unique_constraintsZcan_use_chunked_readsZcan_return_columns_from_insertZ can_return_rows_from_bulk_insertZhas_bulk_insertZuses_savepointsZcan_release_savepointsZrelated_fields_match_typeZallow_sliced_subqueries_with_inZhas_select_for_updateZhas_select_for_update_nowaitZ!has_select_for_update_skip_lockedZhas_select_for_update_ofZhas_select_for_no_key_updateZselect_for_update_of_columnZ#test_db_allows_multiple_connectionsZsupports_unspecified_pkZsupports_forward_referencesZtruncates_namesZhas_real_datatypeZsupports_subqueries_in_group_byZ*ignores_unnecessary_order_by_in_subqueriesZhas_native_uuid_fieldZhas_native_duration_fieldZsupports_temporal_subtractionZsupports_regex_backreferencingZ!supports_date_lookup_using_stringZsupports_timezonesZhas_zoneinfo_databaseZ-requires_explicit_null_ordering_when_groupingZnulls_order_largestZ supports_order_by_nulls_modifierZorder_by_nulls_firstZmax_query_paramsZallows_auto_pk_0Zcan_defer_constraint_checksZsupports_tablespacesZsupports_sequence_resetZcan_introspect_defaultZcan_introspect_foreign_keysZintrospected_field_typesZsupports_index_column_orderingZ!can_introspect_materialized_viewsZcan_distinct_on_fieldsZatomic_transactionsZcan_rollback_ddlZ+schema_editor_uses_clientside_param_bindingZsupports_combined_altersZsupports_foreign_keysZcan_create_inline_fkZcan_rename_indexZindexes_foreign_keysZ!supports_column_check_constraintsZ supports_table_check_constraintsZ can_introspect_check_constraintsZsupports_paramstyle_pyformatZrequires_literal_defaultsZsupports_expression_defaultsZ"supports_default_keyword_in_insertZ'supports_default_keyword_in_bulk_insertZconnection_persists_old_columnsr   Zclosed_cursor_error_classZhas_case_insensitive_likeZbare_select_suffixZimplied_column_nullZ%supports_select_for_update_with_limitZgreatest_least_ignores_nullsZcan_clone_databasesZignores_table_name_caseZfor_update_after_fromZsupports_select_unionZsupports_select_intersectionZsupports_select_differenceZ%supports_slicing_ordering_in_compoundZ supports_parentheses_in_compoundZ#requires_compound_order_by_subqueryZ supports_aggregate_filter_clauseZsupports_index_on_text_fieldZsupports_over_clauseZ#supports_frame_range_fixed_distanceZsupports_frame_exclusionZ4only_supports_unbounded_with_preceding_and_followingZsupports_cast_with_precisionZtime_cast_precisionZ(create_test_procedure_without_params_sqlZ(create_test_procedure_with_int_param_sqlZsupports_callproc_kwargsÚsetZsupported_explain_formatsZsupports_default_in_lead_lagZsupports_ignore_conflictsZsupports_update_conflictsZ%supports_update_conflicts_with_targetZrequires_casted_case_in_updatesZsupports_partial_indexesZ%supports_functions_in_partial_indexesZsupports_covering_indexesZsupports_expression_indexesZcollate_as_index_expressionZ*allows_multiple_constraints_on_same_fieldsZ&supports_boolean_expr_in_select_clauseZsupports_comparing_boolean_exprZsupports_json_fieldZcan_introspect_json_fieldZ!supports_primitives_in_json_fieldZhas_native_json_fieldZhas_json_operatorsZsupports_json_field_containsZ-json_key_contains_list_matching_requires_listZhas_json_object_functionZsupports_collation_on_charfieldZsupports_collation_on_textfieldZ%supports_non_deterministic_collationsZsupports_commentsZsupports_comments_inlineZ!supports_stored_generated_columnsZ"supports_virtual_generated_columnsZsupports_logical_xorZ+prohibits_null_characters_in_text_exceptionZsupports_unlimited_charfieldZsupports_tuple_lookupsZtest_collationsZtest_now_utc_templateZinsert_test_table_with_defaultsZrounds_to_evenZdjango_test_expected_failuresZdjango_test_skipsr   r   r   r#   r'   r   r   r   r   r      sJ   ñû

r   N)Z	django.dbr   Zdjango.utils.functionalr   r   r   r   r   r   Ú<module>   s    