관리-도구
편집 파일: reflection.cpython-311.pyc
� �܋fcG � �� � d dl Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lm Z dd lmZ ddlmZ G d� d e� � Z e j G d� de� � � � ZdZdd�Zd� ZdS )� N� )�_EnumeratedValues)�SET)�DATETIME)�TIME)� TIMESTAMP� )�log)�types)�utilc � � e Zd ZdZd� ZdS )�ReflectedStatez;Stores raw information about a SHOW CREATE TABLE statement.c �Z � g | _ i | _ d | _ g | _ g | _ g | _ d S �N)�columns� table_options� table_name�keys�fk_constraints�ck_constraints)�selfs �[/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/mysql/reflection.py�__init__zReflectedState.__init__ s5 � ������������ � ��� ����� N)�__name__� __module__�__qualname__�__doc__r � r r r r s) � � � � � �E�E�!� !� !� !� !r r c �^ � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � ZdZ d� Zd � Zd� ZdS )�MySQLTableDefinitionParserz4Parses the results of a SHOW CREATE TABLE statement.c �J � || _ || _ | � � � d S r )�dialect�preparer� _prep_regexes)r r# r$ s r r z#MySQLTableDefinitionParser.__init__$ s( � ���� �� ��������r c �� � t � � }||_ t j d|� � D �]5}|� d| j j z � � r| � ||� � �<|� d� � r| � ||� � �h|dk r�o|� d� � r| � ||� � ��|s��| � |� � \ }}|�t j d|z � � ��|dk r|j � |� � ��|dk r|j � |� � ��|d k r|j � |� � ��5��7|S ) Nz\r?\nz z) �)zCREATE zUnknown schema content: %r�key� fk_constraint� ck_constraint)r �charset�re�split� startswithr$ � initial_quote� _parse_column�_parse_table_options�_parse_table_name�_parse_constraintsr �warnr �appendr r )r �show_creater+ �state�line�type_�specs r �parsez MySQLTableDefinitionParser.parse) s� � �� � ���� ��H�X�{�3�3� � �D����t�d�m�&A�A�B�B� ��"�"�4��/�/�/�/�����&�&� ��)�)�$��6�6�6�6����������+�+� ��&�&�t�U�3�3�3�3� � ��"�5�5�d�;�;���t��=��I�:�T�A�B�B�B�B��e�^�^��J�%�%�d�+�+�+�+��o�-�-��(�/�/��5�5�5�5��o�-�-��(�/�/��5�5�5�5���r c �� � | j � |� � }|r�|� � � }| � |d � � |d<