Fixed unnecessary import. (#113)

This commit is contained in:
long2ice
2020-12-29 19:12:36 +08:00
parent 78a15f9f19
commit 530e7cfce5
4 changed files with 7 additions and 4 deletions

View File

@@ -1 +1 @@
__version__ = "0.4.3"
__version__ = "0.4.4"

View File

@@ -3,7 +3,6 @@ from typing import List, Optional
from ddlparse import DdlParse
from tortoise import BaseDBAsyncClient
from tortoise.backends.mysql.client import MySQLSchemaGenerator
class InspectDb:
@@ -24,7 +23,7 @@ class InspectDb:
self.DIALECT = conn.schema_generator.DIALECT
async def show_create_tables(self):
if self.DIALECT == MySQLSchemaGenerator.DIALECT:
if self.DIALECT == "mysql":
if not self.tables:
sql_tables = f"SELECT table_name FROM information_schema.tables WHERE table_schema = '{self.conn.database}';" # nosec: B608
ret = await self.conn.execute_query(sql_tables)