fix: db.connect() возвращает ошибку, /test показывает детали

This commit is contained in:
2026-06-13 12:34:55 +04:00
parent 23cec8686e
commit c7fbc4dc07
3 changed files with 14 additions and 13 deletions
+4 -4
View File
@@ -10,9 +10,9 @@ def test():
# GET — статус
if request.method == "GET":
conn = db.connect()
conn, err = db.connect()
return jsonify({
"db": "ok" if conn else "fail",
"db": "ok" if conn else f"fail: {err}",
"actions": [
"GET /test — статус БД",
"POST /test SQL:... — выполнить запрос",
@@ -25,8 +25,8 @@ def test():
action = data.get("action", "status")
if action == "status":
conn = db.connect()
return jsonify({"db": "ok" if conn else "fail"})
conn, err = db.connect()
return jsonify({"db": "ok" if conn else f"fail: {err}"})
if action == "tables":
result, err = db.query(