Fix Gitea MCP ESM resolution error, update configuration, and include project tests/migration files
This commit is contained in:
29
check_tables.py
Normal file
29
check_tables.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import pymysql
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
def show_tables():
|
||||
conn = pymysql.connect(
|
||||
host=os.getenv('DB_HOST', 'localhost'),
|
||||
user=os.getenv('DB_USER', 'root'),
|
||||
password=os.getenv('DB_PASSWORD', '45278434'),
|
||||
database='PM_proto_test',
|
||||
charset='utf8mb4',
|
||||
cursorclass=pymysql.cursors.DictCursor
|
||||
)
|
||||
try:
|
||||
with conn.cursor() as cursor:
|
||||
cursor.execute("SHOW TABLES")
|
||||
tables = cursor.fetchall()
|
||||
print("Tables in PM_proto_test:")
|
||||
for t in tables:
|
||||
print(f" - {list(t.values())[0]}")
|
||||
except Exception as e:
|
||||
print(f"Error occurred: {e}")
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
show_tables()
|
||||
Reference in New Issue
Block a user