How to Query a PostgreSQL Database in Plain English (Free, 100% Local)

You know the question you want answered. You just don't want to remember the exact JOIN, the window function, or which table the created_at lives on. Here's how to ask PostgreSQL in plain English — and get real SQL and results back — without your data ever leaving your machine.

Most database questions are simple in your head: "How many users signed up last month?", "What are my top 10 products by revenue this quarter?", "Which customers haven't ordered in 90 days?" Turning those into correct SQL is the tedious part — especially against a schema you didn't design or haven't touched in months.

dbclaw is a free, local-first desktop app that does exactly that translation. You type a question, it reads your live schema, writes read-only SQL, runs it, and shows you the table. This guide walks through it end to end with PostgreSQL.

What you'll need

Step 1 — Install dbclaw

Grab the latest Windows build from the releases page. The *-setup.exe installer is recommended — it's a per-user install, needs no admin rights, and updates itself.

⚠️ The builds are currently unsigned, so Windows SmartScreen shows "Windows protected your PC". Click More info → Run anyway. (Removing that prompt needs a paid code-signing certificate, which is on the list.)

Step 2 — Connect your PostgreSQL database

Open the connection switcher in the top-left and choose Add connection. Pick PostgreSQL and fill in:

FieldExample
Hostlocalhost or db.example.com
Port5432
Databaseapp_production
User / Passwordyour database user (read access is enough)

SSL modes are supported for managed databases. Click Test to verify, then Save. Your password is stored in your operating system's keychain — never in a plain config file.

💡 Use a read-only database user if you have one. dbclaw already refuses to run anything that writes (see below), but a read-only role is good defense in depth.

Step 3 — Pick an AI model

dbclaw uses a large language model to translate English into SQL. Open Settings → LLM provider and choose one:

Step 4 — Ask your first question

Open the Chat tab, select your Postgres connection, and type a question like:

How many users signed up in the last 30 days?

dbclaw reads your schema, writes SQL similar to this, runs it, and shows you the number:

SELECT count(*)
FROM users
WHERE created_at >= now() - interval '30 days';

Because it's a chat, you can keep going without repeating yourself:

Now break that down by signup source, highest first.

It remembers the context and adjusts the query. Try things like:

Every answer shows the exact SQL it ran, so you can learn from it, copy it, or paste it into your own tooling.

It's read-only and local-first by design

Two things matter when you point an AI at a production database:

When a query fails, it fixes itself

Real schemas are messy — a column is named signup_ts instead of created_at, or a table got renamed. When generated SQL errors out, dbclaw re-reads your live schema, corrects the query, and retries — then shows you what it changed. You get the answer instead of a stack trace.

Beyond a single Postgres database

Once you're set up, the same plain-English approach works across everything dbclaw connects to:

FAQ

Do I need to know SQL?

No. Ask in plain English. If you do know SQL, there's a Query tab where you can write it yourself (read-only).

Is it really free?

Yes — dbclaw is free to download and use on Windows. If you use a cloud AI provider you pay that provider for tokens; with a local Ollama model there's no cost at all.

Will it touch my data?

No writes, ever. Queries are read-only and your rows never get sent to the AI — only your question and the schema.

Try it on your own database

Free, local-first, read-only. No account needed.

Download dbclaw for Windows

Keep reading

Natural-language SQL with a local LLM (Ollama) → Query across Postgres, MySQL, SQL Server & MongoDB at once → Full documentation →