{"repo":"benodiwal/pg_ai_query","free":true,"listed":false,"github":"https://github.com/benodiwal/pg_ai_query","clone":"git clone https://github.com/benodiwal/pg_ai_query.git","description":"postgresql extension that converts natural language to sql","language":"C++","stars":247,"topics":["ai","postgresql","postgresql-extension"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"PostgreSQL AI Query Extension A powerful PostgreSQL extension that generates SQL queries from natural language using state-of-the-art AI models from OpenAI, Anthropic, and Google Gemini. Features - Natural Language to SQL : Convert plain English descriptions into valid PostgreSQL queries - Automatic Schema Discovery : Analyzes your database schema to understand table structures and relationships - Intelligent Query Generation : Creates optimized queries with appropriate JOINs, WHERE clauses, and LIMIT constraints - Query Performance Analysis : Run EXPLAIN ANALYZE on queries and get AI-powered performance insights and optimization suggestions - Configurable Response Formatting : Choose between plain SQL, enhanced text with explanations, or structured JSON responses - Safety First : Built-in protections against dangerous operations and unauthorized system table access - Flexible Configuration : File-based configuration with support for API keys, model selection, and response formatting Quick Start Installation 1. Prerequisites : - PostgreSQL 14+ with development headers - CMake 3.16+ - C++20 compatible compiler - API key from OpenAI, Anthropic, or Google (Gemini) - If building PostgreSQL from source: use ./configure --enable-nls (required for extension compilation) 2. Build and Install : 3. Enable Extension : Configuration Create /.pg ai.config : Available Models: You can use any valid Anthropic, OpenAI and Gemini model name. Basic Usage Response Formats Plain SQL (default) : E","default_branch":null,"files":null,"tree":[],"storefront":"/r/benodiwal","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/benodiwal/pg_ai_query/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}