FastAPI service handling NL to SQL conversion, schema exploration, and safe query execution.
- GenAI Integration: Uses Gemini 1.5 Flash with optimized system instructions.
- SQL Guardrails: Custom validator blocks non-SELECT statements.
- Schema Reflection: Real-time introspection of the
publicschema. - Table Creator: Support for common PostgreSQL types (
INT,TEXT,REAL, etc).
- Framework: FastAPI
- DB Driver: Psycopg2
- Validation: Pydantic v2
- AI: Google Generative AI
- Install:
pip install -r requirements.txt - Env: Set
GEMINI_API_KEYand DB credentials in.env. - Run:
uvicorn main:app --reload