o
    uvXjÄ  ã                   @   s4   d dl Z d dlmZ d dlmZ G dd„ deƒZdS )é    N)ÚBaseDatabaseFeatures)Úcached_propertyc                   @   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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#h d£Z$dZ%e&dd	„ ƒZ'e&d
d„ ƒZ(e&dd„ ƒZ)e&dd„ ƒZ*e&dd„ ƒZ+e&dd„ ƒZ,e-e. /d¡ƒZ0e&dd„ ƒZ1e&dd„ ƒZ2e&dd„ ƒZ3e&dd„ ƒZ4dS )ÚDatabaseFeatures© FTÚIntegerFieldz…
        CREATE PROCEDURE test_procedure ()
        BEGIN
            DECLARE V_I INTEGER;
            SET V_I = 1;
        END;
    z’
        CREATE PROCEDURE test_procedure (P_I INTEGER)
        BEGIN
            DECLARE V_I INTEGER;
            SET V_I = P_I;
        END;
    >   ÚJSONÚTEXTÚTRADITIONALc                 C   sJ   | j  ¡ �}| d¡ | ¡ }W d  ƒ |d S 1 sw   Y  |d S )zGInternal method used in Django tests. Don't rely on this from your codezGSELECT ENGINE FROM INFORMATION_SCHEMA.ENGINES WHERE SUPPORT = 'DEFAULT'Nr   ©Ú
connectionÚcursorÚexecuteÚfetchone©Úselfr   Úresultr   r   ú^/var/www/html/myproject/venv/lib/python3.10/site-packages/django/db/backends/mysql/features.pyÚ_mysql_storage_engine;   s   


þýz&DatabaseFeatures._mysql_storage_enginec                 C   ó
   | j dkS )z-Confirm support for introspected foreign keysÚMyISAM©r   ©r   r   r   r   Úcan_introspect_foreign_keysC   ó   
z,DatabaseFeatures.can_introspect_foreign_keysc                 C   sD   | j  ¡ �}| d¡ | ¡ d uW  d   ƒ S 1 sw   Y  d S )Nz%SELECT 1 FROM mysql.time_zone LIMIT 1r
   )r   r   r   r   r   Úhas_zoneinfo_databaseH   s   

$þz&DatabaseFeatures.has_zoneinfo_databasec                 C   sP   | j  ¡ �}| d¡ | ¡ }|o|d dkW  d   ƒ S 1 s!w   Y  d S )NzSELECT @@SQL_AUTO_IS_NULLr   é   r
   r   r   r   r   Úis_sql_auto_is_null_enabledO   ó
   
$ýz,DatabaseFeatures.is_sql_auto_is_null_enabledc                 C   s    | j jr
| j jdkS | j jdkS )N)é
   é   )é   r   r   ©r   Úmysql_is_mariadbÚmysql_versionr   r   r   r   Úsupports_over_clauseV   s   z%DatabaseFeatures.supports_over_clausec                 C   s   | j j o
| j jdkS )N)r    r   r   r!   r   r   r   r   Ú!has_select_for_update_skip_locked\   s   z2DatabaseFeatures.has_select_for_update_skip_lockedr%   c                 C   s   | j j o
| j jdk S )N)é   é   r!   r   r   r   r   Úneeds_explain_extendedb   s   z'DatabaseFeatures.needs_explain_extendedc                 C   r   )zI
        All storage engines except MyISAM support transactions.
        r   r   r   r   r   r   Úsupports_transactionsg   s   
z&DatabaseFeatures.supports_transactionsc                 C   sP   | j  ¡ �}| d¡ | ¡ }|o|d dkW  d   ƒ S 1 s!w   Y  d S )NzSELECT @@LOWER_CASE_TABLE_NAMESr   r
   r   r   r   r   Úignores_table_name_casen   r   z(DatabaseFeatures.ignores_table_name_casec                 C   s
   | j j S )N)r   r"   r   r   r   r   Úsupports_default_in_lead_lagu   r   z-DatabaseFeatures.supports_default_in_lead_lagN)5Ú__name__Ú
__module__Ú__qualname__Úempty_fetchmany_valueÚupdate_can_self_selectÚallows_group_by_pkÚrelated_fields_match_typeÚallow_sliced_subqueries_with_inÚhas_select_for_updateÚsupports_forward_referencesÚsupports_regex_backreferencingÚ!supports_date_lookup_using_stringÚcan_introspect_autofieldÚcan_introspect_binary_fieldÚcan_introspect_duration_fieldÚ"can_introspect_small_integer_fieldÚ%can_introspect_positive_integer_fieldÚintrospected_boolean_field_typeÚsupports_index_column_orderingÚsupports_timezonesÚ-requires_explicit_null_ordering_when_groupingÚallows_auto_pk_0Úcan_release_savepointsÚatomic_transactionsÚ!supports_column_check_constraintsÚ supports_table_check_constraintsÚcan_clone_databasesÚsupports_temporal_subtractionÚsupports_select_intersectionÚsupports_select_differenceÚ%supports_slicing_ordering_in_compoundÚsupports_index_on_text_fieldÚhas_case_insensitive_likeÚ(create_test_procedure_without_params_sqlÚ(create_test_procedure_with_int_param_sqlÚ!db_functions_convert_bytes_to_strÚsupported_explain_formatsÚsupports_partial_indexesr   r   r   r   r   r$   r%   ÚpropertyÚoperatorÚ
attrgetterÚhas_select_for_update_nowaitr(   r)   r*   r+   r   r   r   r   r      sr    








r   )rS   Ú django.db.backends.base.featuresr   Údjango.utils.functionalr   r   r   r   r   r   Ú<module>   s    