From e185095e28a38a395c362710aa8c89dce071912b Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 17 Jul 2026 10:18:10 -0500 Subject: [PATCH] fix: use raw RDB$FIELD_NAME key instead of alias for Firebird metadata query --- app/routes/debug_fb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes/debug_fb.py b/app/routes/debug_fb.py index f3ba75c..e9a2933 100644 --- a/app/routes/debug_fb.py +++ b/app/routes/debug_fb.py @@ -26,7 +26,7 @@ async def listar_diagnosticos( # Estructura de la tabla ok_c, _, cols = fb.execute_query( - "SELECT TRIM(f.RDB$FIELD_NAME) AS col " + "SELECT f.RDB$FIELD_NAME " "FROM RDB$RELATION_FIELDS f " "WHERE TRIM(f.RDB$RELATION_NAME) = 'DIAGNOSTICO' " "ORDER BY f.RDB$FIELD_POSITION", None @@ -58,7 +58,7 @@ async def listar_diagnosticos( return JSONResponse({ "ok": True, "total": cnt[0]["TOTAL"] if ok_n and cnt else "?", - "columnas": [c["col"] for c in cols] if ok_c and cols else [], + "columnas": [list(c.values())[0].strip() for c in cols] if ok_c and cols else [], "limite": limit, "filtro": q or None, "rows": [{"cod": r["cod"], "concepto": r["concepto"]} for r in (rows or [])],