cloudquery/pg_gpt
cloudquery/pg_gpt has 456 GitHub stars and 18 forks. Star changes are not measured yet. Last checked 2026-11-09 05:07 UTC. Last push 2023-06-04.
So werden diese Zahlen gemessen
Experimental extension that brings OpenAI API to your PostgreSQL to run queries in human language.
Gemessener Sternzuwachs
- in 24h
- Verlauf wird gesammelt
- in 7 days
- Verlauf wird gesammelt
- in 15 days
- Verlauf wird gesammelt
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalPostgres <> ChatGPT
Experimental PostgreSQL extension that enables the use of OpenAI GPT API inside PostgreSQL, allowing for queries to be written using natural language.
Demo
https://user-images.githubusercontent.com/1121616/228234378-40c796d3-0a38-465a-92da-9370fb21b93b.mp4
(This demo uses data from the Hacker News and Azure CloudQuery plugins)
How does it work?
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.
Before you start
- Note: This plugins sends schema (without the data) to OpenAI GPT API, so it is not recommended to use it on production databases.
- Note: This is an experimental plugin and not officially supported by CloudQuery.
Installation
Requires pgx. Install this first:
cargo install --locked cargo-pgx
cargo pgx init
Now 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 shell
create 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;
Available Functions
gpt(text)- Generates a query based on the user input and the full database schema. This works fine for databases with small schemas.gpt_tables(table_pattern, text)- Similar to gpt, but only uses the tables that match the pattern. The pattern is passed to atable_name LIKEquery, so%can be used as wildcard.
Installing the extension on an existing Postgres instance
First run:
cargo pgx install
This 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
Limitations
- Schema Size - Currently we use gpt-3.5-turbo, which is limited to 4096 tokens. Use
gpt_tablesto narrow down the set of tables.
Ähnliche Projekte entdecken
Asabeneh/30-Days-Of-Python
Die Programmier-Challenge 30 Days of Python ist eine Schritt-für-Schritt-Anleitung, um die Programmiersprache Python in 30 Tagen zu lernen. Diese Challenge kann mehr als 100 Tage dauern. Gehe in deinem eigenen Tempo vor. Diese Videos können ebenfalls helfen: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,423 Sternegrafana/grafana
Offene und kombinierbare Plattform für Observability und Datenvisualisierung. Visualisiert Metriken, Logs und Traces aus mehreren Quellen wie Prometheus, Loki, Elasticsearch, InfluxDB, Postgres und vielen weiteren.
77,763 Sterneredis/redis
Für Entwickler, die echtzeitfähige, datengesteuerte Anwendungen erstellen, ist Redis der bevorzugte, schnellste und funktionsreichste Cache, Datenstrukturserver und die entsprechende Abfrageengine für Dokumente und Vektoren.
77,309 Sterneapache/superset
Apache Superset ist eine Plattform für Datenvisualisierung und Datenexploration.
75,453 Sterne