Neon Postgres text-to-SQL
with the executed SELECT beneath the chart
Neon's own MCP server drives your Neon account from an agent session, and Neon documents it executing queries and applying schema changes on a temporary branch too. Chion is Neon Postgres text-to-SQL on the analysis side. Connect it to any branch read-only, ask "weekly active users on main?", and Chion generates a SELECT, runs it through the application validators, caps the result at 1,000 rows, and renders the chart with the executed SELECT beneath it.
- One read-only connection per Neon branch
- The executed SELECT beneath the chart, capped at 1,000 rows
Read-only SELECT · 1,000-row cap · AES-256-GCM vault · one connection per branch
Each Neon branch carries its own endpoint, so Chion holds staging and main as separate read-only connections and answers on either as an AI analyst for your Postgres. The branch password is sealed in an AES-256-GCM vault and each answer stops at 1,000 rows. Teams ask branch-shaped questions here: "activation funnel by week on the staging branch", "MRR by plan on main", the kind of follow-up thread analytics in conversation is for. Save one of those queries and Chion compiles it into a reusable SQL skill for Claude Code or Codex, which is how a SQL workforce keeps its work. The same setup runs on any PostgreSQL provider.
Point Chion at one Neon branch at a time
What changes when your PostgreSQL is serverless and branch-based.
Analyze a staging branch without touching production
Each Neon branch has its own host. Create one Chion connection per branch, typically a staging branch off main, so analytics on staging never touch production data.
Read-only by code, not by promise
Every query is a code-validated SELECT capped at 1,000 rows.
Cold starts on scale-to-zero
A Neon compute scales to zero after inactivity, so the first query on an idle branch waits for the compute to start. Turn scale to zero off on that compute when the first query has to start right away. Neon documents the current resume behavior.
Pooled vs direct connections
Toggle connection pooling in the Connect modal. Chion works with either the pooled or the direct endpoint; pick pooling for high-concurrency branches.
Copy-on-write resets and PITR
Branches are copy-on-write. A branch reset reverts to the parent's state at branch-creation time; use point-in-time restore on the parent for a more recent snapshot, then refresh the connection in Chion.
A free Neon project connects the same way
Chion connects to a free Neon project exactly as it connects to a paid one. The compute a question uses counts against Neon's current plan limits. See how Chion compiles a code-validated SQL pipeline and the read-only security model.
A saved query compiles into a portable SQL skill
Save a query a reviewer has checked and Chion compiles it into a skill you run in Claude Code or Codex. The skill travels with the query text and its context. The branch connection stays on your side, so each runtime still needs its own access path.
Example question & SQL
See what Chion generates from a plain-English question.
You ask
"Show me signup trends by week for the last 3 months"
Chion generates
SELECT
date_trunc('week', created_at) AS week,
COUNT(*) AS signups
FROM users
WHERE created_at >= now() - interval '3 months'
GROUP BY 1
ORDER BY 1;Create a read-only Postgres role
Run this once before you connect. Chion enforces read-only at the SQL validator, but a least-privilege role is the canonical pattern.
CREATE ROLE chion_read LOGIN PASSWORD '<strong-password>';
GRANT CONNECT ON DATABASE <dbname> TO chion_read;
GRANT USAGE ON SCHEMA public TO chion_read;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO chion_read;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO chion_read;Replace <dbname> with your database name. The ALTER DEFAULT PRIVILEGES line ensures new tables are auto-readable.
Connection string format
Reference for parsing. Chion accepts the six fields directly, no string concatenation needed.
postgresql://chion_read:<password>@ep-<id>.<region>.aws.neon.tech/neondb?sslmode=requireFinding your Neon credentials
Project Dashboard → Connect button
| Field | Where to Find | Default |
|---|---|---|
| Server (Host) | Connect modal → displayed in connection string | ep-<name>-<id>.us-east-2.aws.neon.tech |
| Port | Connect modal | 5432 |
| Database | Connect modal · selectable dropdown | neondb |
| Schema | Not in UI; default is public | public |
| User (Role) | Connect modal · selectable dropdown | neondb_owner |
| Password | Shown in the connection string in the Connect modal | (always visible in modal) |
Quick steps
- 1.Log in at console.neon.tech
- 2.Select your project
- 3.Click the Connect button on the Project Dashboard
- 4.The "Connect to your database" modal opens
- 5.Select your Branch, Compute, Database, and Role from dropdowns
- 6.All connection parameters including password are displayed in the connection string
- 7.Toggle Connection pooling on/off to switch between pooled and direct connections
Password is always visible in the Connect modal; no need to reset.
Open Neon consoleNeon troubleshooting
Common issues and how to fix them.
Serverless resume delay
The branch compute has scaled to zero, so your first query is waiting on a restart rather than running slowly. Wait it out, or turn scale to zero off for that compute in the Neon console. Neon's scale-to-zero documentation, linked below, carries the current behavior.
Branch confusion: wrong data
Neon uses branches. Make sure you selected the correct branch in the Connect modal before copying credentials. Each branch has its own endpoint hostname.
Connection pooling toggle
In the Neon Connect modal, toggle "Connection pooling" on for pooled connections or off for direct. Chion works with both modes.
Branch reset lost recent data
Neon branches use copy-on-write. Resetting a branch reverts it to the parent's state at branch-creation time. Use point-in-time restore (PITR) on the parent if you need a more recent state.
Official Neon documentation
Authoritative references from the provider. Opens in a new tab.
- Neon connection strings
How to construct and parse Neon connection URIs.
- Neon branching
Branch creation, copy-on-write semantics, and reset behavior.
- Point-in-time restore
How PITR interacts with branches and connected applications.
- Neon scale to zero
Current resume behavior for a compute that has scaled to zero, checked 2026-08-31.
- Neon MCP server
What Neon's own MCP server exposes, including its querying tools, checked 2026-09-01.
- PostgreSQL CREATE ROLE
Reference for the read-only role used by Chion.
Your credentials are encrypted
The password for the Neon branch role is sealed in an AES-256-GCM envelope. Plaintext is decrypted into memory for a single request, held for at most 60 seconds or five reads, then purged. Chion connects read-only, and a generated statement that is not a single read-only SELECT never reaches the branch. The grants and row-level security on that branch role decide which rows an answer can contain.
Read the full security modelFrequently asked questions
Common questions about using Chion with Neon.
Can I connect Chion to a Neon branch?
Does Chion work with Neon's free tier?
What is the default database name on Neon?
Does Chion support Neon point-in-time restore?
Can I use Neon branches for staging vs production?
Do I need the Neon MCP server to query Neon in natural language?
Other PostgreSQL providers
Chion connects to Neon, Supabase, Amazon RDS, Google Cloud SQL, and Azure Database for PostgreSQL.
Ready to connect your Neon database?
Open Chion, enter your credentials, and start asking questions in plain English.
Start your 7-day trial