Intelex / tests /testdb.py
yakub
Initial cloud-ready commit
b2b6341
Raw
History Blame Contribute Delete
500 Bytes
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)