관리-도구
편집 파일: reflection.cpython-37.pyc
B ��4]�E � @ s� d dl Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lm Z dd lmZ ddlmZ G dd � d e�Z e jG dd� de��ZdZddd�Zdd� ZdS )� N� )�_EnumeratedValues)�SET)�DATETIME)�TIME)� TIMESTAMP� )�log)�types)�utilc @ s e Zd ZdZdd� ZdS )�ReflectedStatez;Stores raw information about a SHOW CREATE TABLE statement.c C s( g | _ i | _d | _g | _g | _g | _d S )N)�columns� table_options� table_name�keys�fk_constraints�ck_constraints)�self� r �W/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/dialects/mysql/reflection.py�__init__ s zReflectedState.__init__N)�__name__� __module__�__qualname__�__doc__r r r r r r s r c @ st e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� ZdZ dd� Zdd� Zdd� ZdS )�MySQLTableDefinitionParserz4Parses the results of a SHOW CREATE TABLE statement.c C s || _ || _| �� d S )N)�dialect�preparer� _prep_regexes)r r r r r r r $ s z#MySQLTableDefinitionParser.__init__c C s� t � }||_x�t�d|�D ]�}|�d| jj �r>| �||� q|�d�rV| �||� q|dkr`q|�d�rx| � ||� q|s~q| � |�\}}|d kr�t�d| � q|dkr�|j �|� q|dkr�|j�|� q|d kr|j�|� qqW |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 Zshow_creater# �state�line�type_�specr r r �parse) s0 z MySQLTableDefinitionParser.parsec C s: | j �|�}|r�|�� }| �|d �|d<