feat: enable unlimited historical data fetching for EIX
All checks were successful
Deployment / deploy-docker (push) Successful in 15s

This commit is contained in:
Melchior Reimers
2026-01-23 19:19:52 +01:00
parent 454807c30a
commit dae3e9eb29
2 changed files with 267 additions and 135 deletions

View File

@@ -138,6 +138,18 @@ async def get_analytics(
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
@app.get("/api/metadata/search")
async def search_metadata(q: str):
# Case-insensitive search for ISIN or Name
query = f"select isin, name from metadata where isin ilike '%{q}%' or name ilike '%{q}%' limit 10"
try:
response = requests.get(f"http://{DB_HOST}:9000/exec", params={'query': query}, auth=DB_AUTH)
if response.status_code == 200:
return response.json()
throw_http_error(response)
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
def throw_http_error(res):
raise HTTPException(status_code=res.status_code, detail=f"QuestDB error: {res.text}")