SQLEasy is a simple and easy way to interact with SQL databases without writing SQL queries, only using Artificial Intelligence.
- postgres
- mssql (sql server)
- OpenAI API Key
Clone the repository and install the dependencies:
gh repo clone vinibgoulart/sqleasy
cd sqleasy
go mod tidy
To use SQLEasy, you can start the cli:
make run_cli
After selecting the database, you can start asking questions.
Clone the repository and install the dependencies:
gh repo clone vinibgoulart/sqleasy
cd sqleasy
go mod tidy
To use SQLEasy, you can start the api server:
make run_api
To start a chat, you need to configure your database connection using POST /database-connect
:
curl -X POST http://localhost:8080/database-connect -d '{"databaseType": "postgres", "host": "localhost", "port": "5432", "username": "postgres", "password": "", "database": "database"}' -H "Content-Type: application/json"
After that, you can start a chat using POST /ai/prompt
:
curl -X POST http://localhost:8080/ai/prompt -d '{"prompt": "What are the duplicated users?"}' -H "Content-Type: application/json"
- You can use the env variable
DEBUG=true
to see the query generated by the AI. - Be clear and concise when asking questions.
- In complex queries, you can help the AI by providing more context.
Contributions are welcome! Please feel free to submit a Pull Request.