The pattern is a Custom GPT plus a thin FastAPI server sitting between ChatGPT and your database. You expose the FastAPI SQL endpoints to the Custom GPT as an Action via an OpenAPI schema; the GPT then takes a plain-English question, calls your API, runs read-only SQL, and returns results, charts or rankings.
TigZig's reference example is a single Custom GPT connected to three live remote databases at once - Supabase, Neon and Aiven - running cricket and Tour de France data. The advantage of the ChatGPT route: a ready-made chat frontend with Python and web search built in, and you can add OAuth with row-level security if needed.
Open-source repo: https://github.com/amararun/shared-fastapi-fixed-databases. Deployment writeup (with a one-click "Copy for AI Coders"): https://www.tigzig.com/post/chatgpt-connected-databases-ai-coder-deployment. Connect ChatGPT to your own Postgres/MySQL: https://www.tigzig.com/rex2-gpt. Custom GPTs hub: https://www.tigzig.com/gpts-landing.
Building something like this? How I work covers the rates, the availability and what I take on.