scribe

command module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 1 Imported by: 0

README

Scribe 📝

scribe is a command line interface for translating natural language prompts into SQL queries. It makes use of OpenAI codex models via the OpenAI API to execute translations.

Usage

You will need to set the OPENAI_API_KEY environment variable.

scribe "all users with first name patrick" --connection "pg://postgres:password@localhost/?sslmode=disable"
SELECT * FROM users WHERE first_name = 'patrick'

The --connection flag is used to supply a connection string to the SQL database. It can also be set with the SCRIBE_CONNECTION environment variable.

How it works

The CLI requires acces to a SQL database you intend to query so that it can introspect the schema to discover available tables, columns and types. You may also supply additional SQL examples from a local file to improve the quality of translations.

Roadmap

  • Additional SQL database support (today only postgres is supported)
  • Interactive "REPL" like terminal experience
  • Option to execute queries on the underlying database and return results

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
repl
Package repl IS STILL A WIP.
Package repl IS STILL A WIP.
pkg

Jump to

Keyboard shortcuts

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