| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Experimental PostgreSQL extension that enables the use of OpenAI GPT API inside PostgreSQL, allowing for queries to be written using natural language.
Postgres.ChatGPT.mp4(This demo uses data from the Hacker News and Azure CloudQuery plugins)
The extension sends a subset of the database schema to ChatGPT and asks it to generate a query based on this and the user input.
Requires pgx. Install this first:
cargo install --locked cargo-pgx
cargo pgx initNow you can install the extension:
git clone https://github.com/cloudquery/pg_gpt
cd pg_gpt
export OPENAI_KEY=<YOUR_KEY>
cargo pgx run
# will drop into psql shellcreate extension pg_gpt;
set openai.key = '<YOUR OPENAPI API KEY HERE>'; -- set your key
select gpt('show me all open aws s3 buckets');
-- will output the following query, so you can execute it
-- select * from aws_s3_bucket;First run:
cargo pgx installThis places the extension in the postgres extensions directory. Then, in your postgres instance, run:
create extension pg_gpt;
set openai.key = '<YOUR OPENAPI API KEY HERE>';
-- proceed to use the extension| Back | FazBrowse Home | New Git URL |