Alan Abishek
← All work

Case 04

Personal project · 2026

Turn plain English into safe SQL in one flow

  • NL → SQL
  • Read-only
  • React + FastAPI

NL-to-SQL stack: React + TypeScript UI, FastAPI backend, PostgreSQL — inspect/edit generated SQL, run read-only queries, export CSV, with demo mode offline.

Solo builder — API, React UI, SQL safety

  • React
  • TypeScript
  • FastAPI
  • PostgreSQL
  • Gemini
View proof on GitHub
  1. 01 Hook

    Analysts shouldn't need to remember JOIN syntax just to answer a simple question.

  2. 02 Context

    Upgraded stack: React 19 + Vite + TypeScript frontend, FastAPI + Gemini SQL generation, Postgres with connection pooling.

  3. 03 Problem

    Natural-language data access is useless if the model writes destructive SQL or the UI hides the query before it hits the database.

  4. 04 Insight

    Trust comes from a visible, editable SQL step plus hard read-only enforcement — not from hiding the model behind a chat bubble.

  5. 05 Exploration

    Added schema explorer, structured logging, /health (DB + Gemini), optional API key, Docker Compose, statement timeouts and row truncation.

  6. 06 Decision

    Constrained the model to analytics/read-only queries and kept generation separate from execution so every query is inspectable.

  7. 07 Solution

    Shipped Query-mint: prompt → SQL preview/edit → execute → table + history + CSV, with demo mode when no backend is wired.

  8. 08 Impact

    Open repo with production-like local run path and safety rails recruiters can verify in the code.

Impact

  • NL→SQL

    Gemini generation

  • RO

    Read-only enforcement

  • Pool

    Timeouts + row limits

  • Docker

    Compose ready