This is simple python application to generate SQL Schema + prompt to ask GPT-3 to generate SQL queries. It also has a simple UI to show results in a table.
- Getting SQL schemas from PostgreSQL
- Compile prompt from SQL Schema
- Wait for user input
- Generate SQL query from prompt + user input
- Show SQL query and ask user to confirm or edit if it is correct before executing it
- Execute SQL query and show results in a table
- DATABASE_URL: PostgreSQL database URL
- OPENAI_TOKEN: OpenAI API token
- APP_PORT: Port to run the application (default: 5000)
- It better to create a virtual environment using
python3 -m venv venv - Install dependencies using
pip install -r requirements.txt - Set environment variables in
.envfile in project root or in your system - Run the application using
python app.pyand openhttp://localhost:5000in your browser
If you have any questions, please contact me at t.me/define
