Show HN: Query Companion (QCP) for your database

sjashwin1 pts0 comments

qcp — Query Companion | AI-Powered PostgreSQL Queries<br>◆ qcp<br>Query Companion<br>AI-powered natural language interface for PostgreSQL. Ask questions about your database in plain English. Get safe, read-only SQL, results, and natural language summaries — all in your terminal.<br>Get StartedView on GitHub

qcp terminal<br>$ qcp ask<br>? What were my top revenue<br>? generating customers<br>? last month?

Generated SQL:<br>SELECT customer_id, SUM(amount)<br>FROM orders<br>WHERE date_trunc('month', created_at)<br>= date_trunc('month', NOW())<br>GROUP BY customer_id<br>ORDER BY SUM(amount) DESC<br>LIMIT 10

Results:<br>Top customers are Acme Corp, TechStart,<br>and Global Solutions with a combined<br>revenue of $245,000 last month.

Installation<br>Choose your preferred installation method<br>npm / pnpm / bunnpm install -g qcp<br>Copy

Homebrew (macOS/Linux)brew tap moduna-ai/qcp && brew install qcp<br>Copy

curl (macOS/Linux)curl -fsSL https://raw.githubusercontent.com/Moduna-AI/qcp/main/scripts/install.sh | sh<br>Copy

PowerShell (Windows)irm https://raw.githubusercontent.com/Moduna-AI/qcp/main/scripts/install.ps1 | iex<br>Copy

Quick Start Guide<br>Get up and running in minutes after installation<br>$ qcp auth<br>Set up your AI provider (Gemini is free and default)

$ qcp connect<br>Connect to your PostgreSQL database

$ qcp schema scan<br>Index your schema locally (data never leaves your machine)

$ qcp ask "What were our top customers last month?"<br>Ask a question in plain English

$ qcp chat<br>Start an interactive multi-question session

Built on Three Principles<br>Safety, trust, and privacy are non-negotiable<br>Safety

Read-only enforcement at the AST level. INSERT, UPDATE, DELETE, and DDL are rejected before execution. Every query runs in a READ ONLY transaction.

Trust

Every generated SQL query is shown before execution. You always know what qcp intends to run against your database.

Privacy

Telemetry never includes SQL, schema metadata, row data, connection URLs, or credentials.

Supported AI Providers<br>Use your preferred AI model<br>Gemini<br>Default<br>gemini-3.5-flash

OpenAI<br>Popular<br>gpt-5.5

Anthropic<br>Advanced<br>claude-opus-4-8

Ollama<br>Private<br>Local

Ready to query your database with natural language?<br>Get started now or contribute on GitHub<br>View on GitHubContribute

query database month install copy companion

Related Articles