from backend.database import engine
from sqlalchemy import text

try:
    with engine.connect() as connection:
        result = connection.execute(text("SELECT DATABASE()"))
        db_name = result.scalar()
        print(f"✅ ¡Conexión exitosa! Estás conectado a la base de datos: {db_name}")
except Exception as e:
    print(f"❌ Error al conectar: {e}")