Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Query Generator

SQL Query Generator is a full-stack web application that converts natural language into SQL queries using an AI model. The goal of this project is to make SQL easier for users who are not comfortable writing queries manually while also making sure the generated queries are safe and valid before execution.

Features

  • Convert natural language into SQL queries using AI.
  • Separate MySQL workspace for every admin to keep data isolated.
  • One admin can create and manage a dedicated user for the workspace.
  • Schema-aware query generation where the AI receives only the database schema instead of actual user data.
  • Hallucination reduction by validating table names and column names against the database schema.
  • Suggests existing tables or columns when an invalid name is requested instead of generating incorrect SQL.
  • SQL validation pipeline before execution to reduce syntax errors and invalid queries.
  • Different handling for SELECT, INSERT, UPDATE, DELETE and DDL queries before execution.
  • Secure user authentication using JWT.
  • Passwords stored securely using bcrypt hashing.
  • Email OTP verification during signup.
  • Role-based access control for Admin and User.
  • Rate limiting to prevent excessive API requests.
  • Helmet middleware for secure HTTP headers.
  • Restricted CORS configuration allowing requests only from trusted frontend origins.
  • Friendly error messages instead of raw database errors.
  • Automatic creation of a dedicated MySQL database for every new admin workspace.

Tech Stack

Frontend

  • React
  • TypeScript
  • Vite

Backend

  • Node.js
  • Express
  • TypeScript

Database

  • MySQL (Railway)
  • MongoDB Atlas

AI

  • Groq API (GPT OSS Model)

Deployment

  • Frontend: Vercel
  • Backend: Render

Live Demo

Frontend: https://sql-query-generator-vert.vercel.app/

Backend API: https://sql-query-generator-lzxx.onrender.com

Future Improvements

  • PostgreSQL support in addition to MySQL.
  • Multiple users under a single workspace.
  • Download query results as CSV or Excel.
  • AI explanation for generated SQL queries.
  • Visual database schema explorer.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages