File size: 500 Bytes
b2b6341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from backend.database.connection import get_connection

try:
    with get_connection() as conn:
        cursor = conn.cursor(dictionary=True)
        cursor.execute("SHOW TABLES")
        tables = cursor.fetchall()
        print("[SUCCESS] Connected! Tables found:")
        for t in tables:
            print(" -", list(t.values())[0])
except Exception as e:
    print("[ERROR] Connection failed:", e)