| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/django/db/backends/oracle/__pycache__/ |
Upload File : |
�
�|�e@7 � � � d dl mZ d dlZd dlmZ d dlmZmZm Z d dl
mZ edej dz � � Z G d� d e� � Z
dS )
� )�
namedtupleN)�models)�BaseDatabaseIntrospection� FieldInfo� TableInfo)�cached_propertyr )�is_autofield�is_jsonc �j � � e Zd ZdZed� � � Z� fd�Zd� Zd� Zd� Z d
d�Z
d � Zd
� Zd� Z
d� Z� xZS )�DatabaseIntrospection� c �j � | j j dk r�t j dt j dt j dt j dt j dt j dt j dt j
dt j dt j dt j
dt j d iS t j dt j dt j dt j dt j dt j dt j dt j dt j dt j dt j d t j diS )
N)� �BinaryField� TextField� DateField� CharField�
DurationField�
FloatField�DecimalField�
DateTimeField)�
connection�cx_oracle_version� cx_Oracle�BLOB�CLOB�DATETIME�
FIXED_CHAR�FIXED_NCHAR�INTERVAL�NATIVE_FLOAT�NCHAR�NCLOB�NUMBER�STRING� TIMESTAMP�DB_TYPE_DATE�DB_TYPE_BINARY_DOUBLE�DB_TYPE_BLOB�DB_TYPE_CHAR�DB_TYPE_CLOB�DB_TYPE_INTERVAL_DS�
DB_TYPE_NCHAR�
DB_TYPE_NCLOB�DB_TYPE_NVARCHAR�DB_TYPE_NUMBER�DB_TYPE_TIMESTAMP�DB_TYPE_VARCHAR)�selfs �I/usr/lib/python3/dist-packages/django/db/backends/oracle/introspection.py�data_types_reversez(DatabaseIntrospection.data_types_reverse s� � ��?�,�t�3�3���
�����"�K��$�k��%�{��"�O��&��������� �.�� �+��#�_�
�
� �&���/���&�
��&���&���-���'���'���*�K��(�.��+�_��)�;�
�
� c �L �� |t j k rY|dd� \ }}|dk r=|dk r|j rdndS d|cxk rdk rn n |j rdS |dk rd S |j rd
S dS |dk rd
S n|t j k r |j rdS t � � � ||� � S )N� � r � �BigAutoField�BigIntegerFieldr
�SmallAutoField�BooleanField� AutoField�IntegerFieldi����r � JSONField)r r$ r r# r
�super�get_field_type)r3 � data_type�description� precision�scale� __class__s �r4 rC z$DatabaseIntrospection.get_field_type3 s� �� �� �(�(�(�*�1�Q�3�/��I�u���z�z��r�>�>�-8�-E�\�>�>�K\�\���&�&�&�&�Q�&�&�&�&�&�;�+C�&�+�+��!�^�^�)�>� �-� *�&�;�)�>��$���#�|� �
�)�/�
)�
)�k�.A�
)��;��w�w�%�%�i��=�=�=r6 c �n � � |� d� � � fd�|� � � D � � S )z>Return a list of table and view names in the current database.a�
SELECT table_name, 't'
FROM user_tables
WHERE
NOT EXISTS (
SELECT 1
FROM user_mviews
WHERE user_mviews.mview_name = user_tables.table_name
)
UNION ALL
SELECT view_name, 'v' FROM user_views
UNION ALL
SELECT mview_name, 'v' FROM user_mviews
c �n �� g | ]1}t �� |d � � |d � � ��2S )r r
)r �identifier_converter��.0�rowr3 s �r4 �
<listcomp>z8DatabaseIntrospection.get_table_list.<locals>.<listcomp>X s9 �� �b�b�b�� �$�3�3�C��F�;�;�S��V�D�D�b�b�br6 )�execute�fetchall)r3 �cursors ` r4 �get_table_listz$DatabaseIntrospection.get_table_listH sH �� ����
�
�
�
� c�b�b�b�PV�P_�P_�Pa�Pa�b�b�b�br6 c �: � |� d|g� � d� |� � � D � � }| xj dz
c_ |� d� | j j � |� � | j � � � � g }|j D ]�}|d }|| \ }}} }
}|i z }|� t | �
|� � g|dd� �|�|d pd�|d pd�|d d
� �|�| �|
�|�R � � � ��|S )zi
Return a description of the table with the DB-API cursor.description
interface.
a>
SELECT
user_tab_cols.column_name,
user_tab_cols.data_default,
CASE
WHEN user_tab_cols.collation = user_tables.default_collation
THEN NULL
ELSE user_tab_cols.collation
END collation,
CASE
WHEN user_tab_cols.char_used IS NULL
THEN user_tab_cols.data_length
ELSE user_tab_cols.char_length
END as internal_size,
CASE
WHEN user_tab_cols.identity_column = 'YES' THEN 1
ELSE 0
END as is_autofield,
CASE
WHEN EXISTS (
SELECT 1
FROM user_json_columns
WHERE
user_json_columns.table_name = user_tab_cols.table_name AND
user_json_columns.column_name = user_tab_cols.column_name
)
THEN 1
ELSE 0
END as is_json
FROM user_tab_cols
LEFT OUTER JOIN
user_tables ON user_tables.table_name = user_tab_cols.table_name
WHERE user_tab_cols.table_name = UPPER(%s)
c �<