pg_gen_query

This extension provides a natural language query interface to Postgres, allowing you do to something like SELECT * FROM pg_gen_query('number of events from Texas').

Usage

Build the extension:

git clone git@github.com:kriti-sc/pg_gen_query.git

in `api_key.hpp`, add OpenAI api key:
const std::string open_api_key = "sk-verylongopenaikey";

make clean && make && make install

Install and use:

CREATE EXTENSION pg_gen_query;

SELECT * FROM pg_qen_query('get all nation names');

Note: first time execution will be slow as the extension develops an understanding of the schema on initialization. This understanding is stored therefore, subsequent executions will be faster.

Example

Below is sample usage against the TPCH schema.

tp...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help