Skip to content

vinibgoulart/sqleasy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLEasy

SQLEasy is a simple and easy way to interact with SQL databases without writing SQL queries, only using Artificial Intelligence.

Supported Databases

  • postgres
  • mssql (sql server)

Requirements

  • OpenAI API Key

CLI

CLI - Installation

Clone the repository and install the dependencies:

gh repo clone vinibgoulart/sqleasy
cd sqleasy
go mod tidy

CLI - Starting a chat

To use SQLEasy, you can start the cli:

make run_cli

After selecting the database, you can start asking questions.

API

API - Installation

Clone the repository and install the dependencies:

gh repo clone vinibgoulart/sqleasy
cd sqleasy
go mod tidy

API - Usage

To use SQLEasy, you can start the api server:

make run_api

API - Starting a chat

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"

Tips

  • 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.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Access your database easily using AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published