from sqlparse.sql import Statement

from mag_db.bean.table_info import TableInfo
from mag_db.parser.base_parser import BaseParser


class DropParser(BaseParser):
    def _parse(self, stmt: Statement) -> TableInfo:
        # 提取表名
        tables = super()._find_table(stmt, {'EXISTS', 'TABLE'})
        return TableInfo(tables)