Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 773 Bytes

File metadata and controls

21 lines (16 loc) · 773 Bytes

AskSQL AI - Backend

FastAPI service handling NL to SQL conversion, schema exploration, and safe query execution.

🚀 Key Features

  • 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 public schema.
  • Table Creator: Support for common PostgreSQL types (INT, TEXT, REAL, etc).

🛠️ Technical Details

  • Framework: FastAPI
  • DB Driver: Psycopg2
  • Validation: Pydantic v2
  • AI: Google Generative AI

🔧 Local Development

  1. Install: pip install -r requirements.txt
  2. Env: Set GEMINI_API_KEY and DB credentials in .env.
  3. Run: uvicorn main:app --reload