o
    `©Zh  ã                   @   sP   d dl Z d dlmZ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)Ú	DataErrorÚInterfaceError)ÚBaseDatabaseFeatures)Úis_psycopg3)Úcached_propertyc                       sv  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dZdZdZdZdZdZeZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'h d£Z(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dd	d	d	d
œZ2dZ3dZ4dhdhdœZ5e6dd„ ƒZ7e6dd„ ƒZ8e6dd„ ƒZ9e6‡ fdd„ƒZ:e6dd„ ƒZ;e6dd„ ƒZ<e6dd„ ƒZ=e>e? @d¡ƒZAe>e? @d¡ƒZBdZCe>e? @d¡ƒZD‡  ZES ) ÚDatabaseFeatures)é   Tz°
        CREATE FUNCTION test_procedure () RETURNS void AS $$
        DECLARE
            V_I INTEGER;
        BEGIN
            V_I := 1;
        END;
    $$ LANGUAGE plpgsql;z½
        CREATE FUNCTION test_procedure (P_I INTEGER) RETURNS void AS $$
        DECLARE
            V_I INTEGER;
        BEGIN
            V_I := P_I;
        END;
    $$ LANGUAGE plpgsql;z¸
        CREATE TABLE test_table_composite_pk (
            column_1 INTEGER NOT NULL,
            column_2 INTEGER NOT NULL,
            PRIMARY KEY(column_1, column_2)
        )
    >   ÚYAMLÚJSONZTEXTÚXMLFÚCzsv-x-icu)ZdeterministicZnon_defaultZ
swedish_ciZvirtualz(STATEMENT_TIMESTAMP() AT TIME ZONE 'UTC'zINSERT INTO {} DEFAULT VALUESzQindexes.tests.SchemaIndexesNotPostgreSQLTests.test_create_index_ignores_opclassesz2lookup.tests.LookupTests.test_textfield_exact_null)zopclasses are PostgreSQL only.z$PostgreSQL requires casting to text.c                 C   s   t ƒ }| jr| dh¡ |S )NzOaggregation.tests.AggregateTestCase.test_group_by_nested_expression_with_params)ÚsetÚuses_server_side_bindingÚupdate)ÚselfZexpected_failures© r   ú]/var/www/html/lang_env/lib/python3.10/site-packages/django/db/backends/postgresql/features.pyÚdjango_test_expected_failures_   s   üÿ	z.DatabaseFeatures.django_test_expected_failuresc                 C   s   | j jd }to| d¡du S )NÚOPTIONSZserver_side_bindingT)Ú
connectionZsettings_dictr   Úget)r   Úoptionsr   r   r   r   n   s   z)DatabaseFeatures.uses_server_side_bindingc                 C   s   t rtdfS tdfS )Nz6PostgreSQL text fields cannot contain NUL (0x00) bytesz6A string literal cannot contain NUL (0x00) characters.)r   r   Ú
ValueError©r   r   r   r   Ú+prohibits_null_characters_in_text_exceptions   s   z<DatabaseFeatures.prohibits_null_characters_in_text_exceptionc                    s   i t ƒ j¥ddddœ¥S )NZBigIntegerFieldZIntegerFieldZSmallIntegerField)ZPositiveBigIntegerFieldZPositiveIntegerFieldZPositiveSmallIntegerField)ÚsuperÚintrospected_field_typesr   ©Ú	__class__r   r   r   z   s   ÿüz)DatabaseFeatures.introspected_field_typesc                 C   ó   | j jdkS )NiÐû ©r   Z
pg_versionr   r   r   r   Úis_postgresql_13ƒ   ó   z!DatabaseFeatures.is_postgresql_13c                 C   r   )Nià" r    r   r   r   r   Úis_postgresql_14‡   r"   z!DatabaseFeatures.is_postgresql_14c                 C   r   )NiðI r    r   r   r   r   Úis_postgresql_15‹   r"   z!DatabaseFeatures.is_postgresql_15r#   r$   )FÚ__name__Ú
__module__Ú__qualname__Zminimum_database_versionZallows_group_by_selected_pksZcan_return_columns_from_insertZ can_return_rows_from_bulk_insertZhas_real_datatypeZhas_native_uuid_fieldZhas_native_duration_fieldZhas_native_json_fieldZcan_defer_constraint_checksZhas_select_for_updateZhas_select_for_update_nowaitZhas_select_for_update_ofZ!has_select_for_update_skip_lockedZhas_select_for_no_key_updateZcan_release_savepointsZsupports_commentsZsupports_tablespacesZsupports_transactionsZ!can_introspect_materialized_viewsZcan_distinct_on_fieldsZcan_rollback_ddlZ+schema_editor_uses_clientside_param_bindingZsupports_combined_altersZnulls_order_largestr   Zclosed_cursor_error_classZgreatest_least_ignores_nullsZcan_clone_databasesZsupports_temporal_subtractionZ%supports_slicing_ordering_in_compoundZ(create_test_procedure_without_params_sqlZ(create_test_procedure_with_int_param_sqlZ,create_test_table_with_composite_primary_keyZrequires_casted_case_in_updatesZsupports_over_clauseZ4only_supports_unbounded_with_preceding_and_followingZ supports_aggregate_filter_clauseZsupported_explain_formatsZ&supports_deferrable_unique_constraintsZhas_json_operatorsZ-json_key_contains_list_matching_requires_listZsupports_update_conflictsZ%supports_update_conflicts_with_targetZsupports_covering_indexesZ!supports_stored_generated_columnsZ"supports_virtual_generated_columnsZcan_rename_indexZtest_collationsZtest_now_utc_templateZinsert_test_table_with_defaultsZdjango_test_skipsr   r   r   r   r   r!   r#   r$   ÚpropertyÚoperatorÚ
attrgetterZhas_bit_xorZ supports_covering_spgist_indexesZsupports_unlimited_charfieldZ*supports_nulls_distinct_unique_constraintsÚ__classcell__r   r   r   r   r   	   sž    üÿÿû






ÿr   )r)   Z	django.dbr   r   Z django.db.backends.base.featuresr   Z)django.db.backends.postgresql.psycopg_anyr   Zdjango.utils.functionalr   r   r   r   r   r   Ú<module>   s    