Skip to content

brucruz/query-generator

Repository files navigation

SQL Queries Generator

Generate SQL queries with AI

Introduction

I decided to create this project because I wanted to have an AI app that I would use personally and that would benefit others as well. I am a software engineer and I work with SQL queries on a daily basis. I thought it would be great to have an AI app that would generate SQL queries for me, which would save me a great deal of time, as I could use it to generate queries for my professional and personal projects.

I expect that product managers and business analysts will also find this app particularly useful, as they usually have a basic SQL knowledge but sometimes are confronted with complex needs.

But it is not exclusive to them, anyone who needs to generate SQL queries can use it.

How to run the app locally

  1. Clone this repository
git clone TODO: add link
  1. Install dependencies
npm install
  1. Add OPENAI_API_KEY to your environment variables
# .env.local
OPENAI_API_KEY=YOUR_OPEN_AI_API_KEY
  1. Run the app
npm run dev

How to use it

  1. Go to localhost:3000
  2. Enter the schema for which you want to generate SQL queries
  3. Enter the question you want to ask
  4. Click on "Generate query"
  5. Copy the generated query by clicking on the "Copy" button

Pending features (that I will add in the future)

  • Add tests
  • Add responsiveness
  • Add a "Copy" button for the schema
  • Interface to add your own OpenAI API key
  • Add support for other databases (currently only supports SQL)
  • Connect to schema databases to get the schema automatically (example: connect to a GitHub repository to get the schema from a SQL file, connect to Prisma, etc)
  • Deploy to Vercel

About

Generate SQL queries with AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published