refactor(agent): Refactor resource of agents (#1518)

This commit is contained in:
Fangyin Cheng
2024-05-15 09:57:19 +08:00
committed by GitHub
parent db4d318a5f
commit 559affe87d
102 changed files with 2633 additions and 2549 deletions

View File

@@ -1,4 +1,5 @@
"""SQLite connector."""
import logging
import os
import tempfile
@@ -122,6 +123,18 @@ class SQLiteConnector(RDBMSConnector):
(table_comment[0], table_comment[1]) for table_comment in table_comments
]
def get_current_db_name(self) -> str:
"""Get current database name.
Returns:
str: database name
"""
full_path = self._engine.url.database
db_name = os.path.basename(full_path)
if db_name.endswith(".db"):
db_name = db_name[:-3]
return db_name
def table_simple_info(self) -> Iterable[str]:
"""Get table simple info."""
_tables_sql = """