fix: use raw RDB$FIELD_NAME key instead of alias for Firebird metadata query
This commit is contained in:
@@ -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 [])],
|
||||
|
||||
Reference in New Issue
Block a user