IDKSQL is a full-stack system that allows users to interact with a PostgreSQL database using plain English.
- Convert it into SQL
- Execute it on the database
- Return results
- Explain what happened
-
Natural Language → SQL (offline using LLM)
-
Full CRUD support
-
SELECT (Read)
-
INSERT (Create)
-
UPDATE (Modify)
-
DELETE (Remove)
-
Real-time query execution on PostgreSQL
-
Query explanation in plain English
-
Chat-based interface with memory
-
Offline-first (no external APIs required)
-
SQL validation & safety checks
- React
- Custom CSS (dark, bold UI)
- Node.js (Express)
- PostgreSQL
- Ollama (local runtime)
- LLaMA 3 (or compatible local model)
User (Natural Language)
↓
Frontend (React UI)
↓
Backend (Express API)
↓
Ollama (LLM → SQL)
↓
SQL Validation Layer
↓
PostgreSQL Database
↓
Results + Explanation
↓
Frontend Display
git clone https://github.com/yourusername/idksql.git
cd idksqlnpm install express pg axios corsnpm install- Create your database
- Import schema from DA2
- Update credentials in backend config
Download and install: https://ollama.com
Run model:
ollama run llama3node server.jsnpm run dev- “Show all training runs”
- “Find runs where loss > 1”
- “Add employee John age 28 salary 45000”
- “Update salary of John to 60000”
- “Delete employee John”
- Blocks dangerous queries (DROP, ALTER, TRUNCATE)
- Requires conditions for UPDATE/DELETE
- Validates SQL before execution
IDKSQL/
├── frontend/
│ ├── components/
│ ├── pages/
│ └── App.jsx
│
├── backend/
│ ├── server.js
│ ├── db.js
│ ├── llm.js
│ └── utils/
│
├── database/
│ └── schema.sql
│
└── README.md
- User enters natural language query
- Backend sends query to local LLM (Ollama)
- LLM generates SQL
- SQL is validated for safety
- Query is executed on PostgreSQL
- Results + explanation are returned
- Accuracy depends on prompt quality and schema clarity
- Complex queries may require refinement
- LLM may occasionally generate incorrect SQL
- Query suggestions / autocomplete
- Visual query builder
- Multi-database support
- Fine-tuned SQL model
Built by C.Kumaran