SQL Genie is a Django-based web application that enables users to interact with databases using plain English. It integrates Google’s Gemini 2.0 Flash language model to convert natural language queries into SQL, supports real-time execution on live databases, and features a robust role-based access system.
- Render : Link
- Python 3.10+
- pip
- SQLite (default) or PostgreSQL (for production)
- Internet access (for Gemini API)
-
Clone the Repository
git clone https://github.com/your-username/sql-genie.git cd sql-genie -
Create a Virtual Environment (Optional but Recommended)
python -m venv env source env/bin/activate # On Windows: env\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Apply Migrations
python manage.py migrate
-
Create a Superuser
python manage.py createsuperuser
-
Start the Development Server
python manage.py runserver 8123
You can use any other port by changing
8123(e.g.,runserver 8000). -
Open in Browser
Visithttp://localhost:8123/in your browser to access the app.
- Upload & manage multiple databases (SQLite/PostgreSQL).
- Assign role-based permissions (read-only or read/write).
- Monitor recent queries executed by users.
- Select an assigned database.
- Type queries in natural language (e.g., "Show all students in grade A").
- View generated SQL and execution results in real time.
- Read-only users are restricted from modifying data.
- Role-Based Access Control (RBAC)
- Superuser-only data modifications
- Gemini API key is stored securely in environment variables (
settings.pyusesGEMINI_API_KEY)
- Django (Python)
- Gemini 2.0 Flash (Google AI)
- HTML + CSS + JS (Bootstrap, AOS)
- SQLite/PostgreSQL
Developed by: Sparsh Sahu, Mahak Mirza, Eashan Tiwari
Under the guidance of Dr. Vasima Khan
SISTec, Department of CSE-AI&DS, Bhopal (M.P.), April 2025