top of page

Connect ChatGPT to Multiple Remote Databases


(Supabase, Neon, Aiven, AWS… doesn’t matter)

The Problem

Databases scattered across providers. Different engines. Different tables.

Users don’t care. They just want an answer.

GPT needs to know where to go.

The Setup (my stack)

1. FastAPI connector – takes SQL, routes to right DB, handles auth.

2. Function calling schema – OpenAPI JSON so GPT knows where to send queries.

3. YAML semantic layer – schema, sample rows, rules, golden queries.

4. Custom instructions – routing rules + answer format.

How it Runs

1. User asks.

2. GPT picks DB + builds SQL.

3. Query sent to FastAPI.

4. FastAPI checks auth → DB runs query.

5. DB → FastAPI → JSON → GPT replies.

Try It Live

Works across Supabase (ODI cricket), Neon (T20 cricket), Aiven (Tour de France). ~2.5M rows, 340MB data, 7.5k matches across past ~22 years + 122 years of Tour history.

Security

IT world has been doing it for decades - API keys, read-only roles, rate limits, role based access, row level security etc. Nothing new. Setup as per your requirements. GPT is just another frontend (OAuth enabled by the way)

Source + Docs



 
 

Recent Posts

See All
bottom of page