o
    ƒælfv  ã                   @   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                       sN  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ddd	œZ0d
Z1dhdhdœZ2e3dd„ ƒZ4e3dd„ ƒZ5e3dd„ ƒZ6e3‡ fdd„ƒZ7e3dd„ ƒZ8e3dd„ ƒZ9e:e; <d¡ƒZ=e:e; <d¡ƒZ>dZ?‡  Z@S )Ú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)
        )
    >   ÚXMLÚJSONÚTEXTÚYAMLÚCzsv-x-icu)ÚdeterministicÚnon_defaultÚ
swedish_ciz(STATEMENT_TIMESTAMP() AT TIME ZONE 'UTC'zQindexes.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)ÚselfÚexpected_failures© r   új/var/www/ticemtrilhas/avaliacao_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ÚOPTIONSÚserver_side_bindingT)Ú
connectionÚsettings_dictr   Úget)r   Úoptionsr   r   r   r   j   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_exceptiono   s   z<DatabaseFeatures.prohibits_null_characters_in_text_exceptionc                    s   i t ƒ j¥ddddœ¥S )NÚBigIntegerFieldÚIntegerFieldÚSmallIntegerField)ÚPositiveBigIntegerFieldÚPositiveIntegerFieldÚPositiveSmallIntegerField)ÚsuperÚintrospected_field_typesr    ©Ú	__class__r   r   r)   v   s   ÿüz)DatabaseFeatures.introspected_field_typesc                 C   ó   | j jdkS )NiÐû ©r   Ú
pg_versionr    r   r   r   Úis_postgresql_13   ó   z!DatabaseFeatures.is_postgresql_13c                 C   r,   )Nià" r-   r    r   r   r   Úis_postgresql_14ƒ   r0   z!DatabaseFeatures.is_postgresql_14r1   )AÚ__name__Ú
__module__Ú__qualname__Úminimum_database_versionÚallows_group_by_selected_pksÚcan_return_columns_from_insertÚ can_return_rows_from_bulk_insertÚhas_real_datatypeÚhas_native_uuid_fieldÚhas_native_duration_fieldÚhas_native_json_fieldÚcan_defer_constraint_checksÚhas_select_for_updateÚhas_select_for_update_nowaitÚhas_select_for_update_ofÚ!has_select_for_update_skip_lockedÚhas_select_for_no_key_updateÚcan_release_savepointsÚsupports_commentsÚsupports_tablespacesÚsupports_transactionsÚ!can_introspect_materialized_viewsÚcan_distinct_on_fieldsÚcan_rollback_ddlÚ+schema_editor_uses_clientside_param_bindingÚsupports_combined_altersÚnulls_order_largestr   Úclosed_cursor_error_classÚgreatest_least_ignores_nullsÚcan_clone_databasesÚsupports_temporal_subtractionÚ%supports_slicing_ordering_in_compoundÚ(create_test_procedure_without_params_sqlÚ(create_test_procedure_with_int_param_sqlÚ,create_test_table_with_composite_primary_keyÚrequires_casted_case_in_updatesÚsupports_over_clauseÚ4only_supports_unbounded_with_preceding_and_followingÚ supports_aggregate_filter_clauseÚsupported_explain_formatsÚ&supports_deferrable_unique_constraintsÚhas_json_operatorsÚ-json_key_contains_list_matching_requires_listÚsupports_update_conflictsÚ%supports_update_conflicts_with_targetÚsupports_covering_indexesÚcan_rename_indexÚtest_collationsÚtest_now_utc_templateÚdjango_test_skipsr   r   r   r!   r)   r/   r1   ÚpropertyÚoperatorÚ
attrgetterÚhas_bit_xorÚ supports_covering_spgist_indexesÚsupports_unlimited_charfieldÚ__classcell__r   r   r*   r   r   	   sŒ    ýÿÿû

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