ai-sql-assistant

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2023 License: MIT Imports: 13 Imported by: 0

README

🤖 ai-sql-assistant

Build Status GoDoc Go Report Card GitHub release

This is a simple AI SQL query builder helper written in GO. It uses OpenAI API to generate a plausible SQL query from a given question. Generated query is executed and results are displayed. And, if you provide a plot question, it will generate a plot for you.

It only supports MySQL and SQLite for now. This project is powered by LinGoose 🪿

ai-sql-assistant

ai-sql-assistant

If you like this project, give it a ⭐️ and share it with friends!

Installation

Be sure to have a working Go environment, then run the following command:

go install github.com/henomis/ai-sql-assistant@latest
From source code

Clone the repository and build the binary:

go build .
Pre-built binaries

Pre-built binaries are available for Linux, Windows and macOS on the releases page.

Usage

⚠️ ai-sql-assistant requires an OpenAI API key as OPENAI_API_KEY environment variable.

Usage of ./ai-sql-assistant:
  -k string
        openai api key (defaults to OPENAI_API_KEY env var)
  -n string
        name of the datasource (database path|connection string)
  -p string
        instructions to plot the datasource
  -q string
        question to ask the datasource
  -t string
        type of the datasource (sqlite|mysql)
ai-sql-assistant -n ./Chinook_Sqlite.sqlite -t sqlite -q "give me top 4 artists name and number of songs"

License

© Simone Vellei, 2023~time.Now() Released under the MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL