pg_ai_query
AI-powered SQL query generation for PostgreSQL
Repository
benodiwal/pg_ai_query
https://github.com/benodiwal/pg_ai_query
Source
pg_ai_query-0.1.1.tar.gz
pg_ai_query-0.1.1.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_ai_query | 0.1.1 | FEAT | Apache-2.0 | C++ |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2720 | pg_ai_query | No | Yes | No | Yes | No | Yes | - |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.1 | 1817161514 | pg_ai_query | - |
| RPM | PIGSTY | 0.1.1 | 1817161514 | pg_ai_query_$v | - |
| DEB | PIGSTY | 0.1.1 | 1817161514 | postgresql-$v-ai-query | - |
Build
You can build the RPM / DEB packages for pg_ai_query using pig build:
Install
You can install pg_ai_query directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
pg_ai_query generates SQL queries from natural language descriptions using LLM providers (OpenAI, Anthropic, Google Gemini). It introspects your database schema and translates plain-English questions into SQL.
Configuration
Create ~/.pg_ai.config:
Query Generation
Schema Discovery
Query Explanation
Pass API credentials directly:
Supported Models
- OpenAI: gpt-4o, gpt-4o-mini
- Anthropic: claude-3-5-sonnet-20241022, claude-3-haiku-20240307
- Google Gemini: gemini-2.5-pro, gemini-2.5-flash
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)