nlqdb

Solve · Backend engineers

How do I add a natural-language query layer over my existing Postgres?

If you already run Postgres and want to ask it questions in English — without building or training a text-to-SQL stack — connect it to nlqdb with `nlq db connect` (or `POST /v1/db/connect`). nlqdb introspects your live schema, compiles English to SQL, runs it on your own database, and shows the SQL every time. Your data never leaves your Postgres.

Backend engineers at small startups already own a Postgres and don't want a second store — they want a natural-language admin layer over the one they run, so a teammate (or an agent) can ask 'how many signups per plan this month?' without filing a SQL ticket. Most text-to-SQL tooling assumes you'll curate a training corpus, embed schema docs, or stand up a RAG layer first. The simple want — point it at the database I already have and let me ask — has had no clean shape.

The snippet that solves it.

> users grouped by signup month with a count of each

What nlqdb does for this

  • Connect your database once with `POST /v1/db/connect` (or `nlq db connect`, the SDK, or `nlqdb_connect_database`, `SK-DBCONN-001`); nlqdb introspects the live schema — no training corpus.
  • Your connection URL is sealed at rest (AES-256-GCM, `GLOBAL-031`); the host is egress-guarded and re-checked before every query (`GLOBAL-035`); only a redacted pill stays unsealed.
  • English compiles to SQL and runs on your own Postgres — every answer returns rows plus the compiled SQL (`SK-WEB-005`) to audit.
  • The data never moves — nlqdb queries your database in place over its own connection; no copy, no ETL, no second store to sync.

Drop into any HTML page

<nlq-data goal="users grouped by signup month with a count of each"></nlq-data>

The kind of ad-hoc admin question you'd otherwise hand-write SQL for — a grouped count over your own schema — answered from one English goal.

What this replaces

What nlqdb doesn't try to do here

  • No anonymous connect — pointing nlqdb at a database you run is a signed-in account verb on the SDK, CLI, and MCP; the public `<nlq-data>` embed holds a read-scoped key, never a connection credential, so the connect step isn't an embed (`GLOBAL-003`).
  • No engine-side guardrails imported onto your database — the per-tenant RLS and server-built-write trust boundary nlqdb applies to databases it provisions are not added to a database you already run; nlqdb executes the compiled SQL with whatever privileges your connection role has, so scope it with a least-privilege (read-only) role.
  • ClickHouse can be connected too, but the planner emits Postgres-flavored SQL and the validator is Postgres-dialect today (a known correctness gap, not a security one) — Postgres is the smooth path; ClickHouse-only syntax may mis-compile until the engine-aware planner lands.

Questions buyers ask

How do I connect my existing Postgres to nlqdb?
Once, with the connect verb: `POST /v1/db/connect { engine: "postgres", connection_url }`, or `nlq db connect`, the SDK `client.databases.connect`, or the MCP `nlqdb_connect_database` tool. nlqdb validates the connection, introspects your schema, seals the URL at rest, and mints a per-database key. After that you ask in English over your own database.
Does my data leave my database when I use natural-language queries?
No. nlqdb queries your Postgres in place over its own connection — there's no copy, no ETL, no analytics mirror. Your connection URL is sealed with AES-256-GCM at rest (`GLOBAL-031`); only a redacted connection pill is stored unsealed for the dashboard. The rows stay in your database.
How is this different from Vanna AI or training a text-to-SQL model on my schema?
There's no training corpus or per-tenant fine-tune to maintain. nlqdb prompts directly from your live schema fingerprint plus a recent-tables hint, caches the plan on `(goal-fingerprint, schema-hash)` (`GLOBAL-006`), and shows the compiled SQL every time. The equivalent of training is the automatic plan cache, not a curated example set you keep alive.
Can I limit what nlqdb is allowed to do on my database?
Yes — connect with a least-privilege role. nlqdb runs the compiled SQL with exactly the privileges your connection URL's role has, so a read-only role keeps it read-only at the engine. On top of that, the SQL validator allowlists verbs and the trace toggle shows every statement before you trust the answer.

Where this pain shows up in public

Enduring discussion hubs where you can verify the theme without taking our word for it. We don't quote individual posts; we cite search-result and subreddit URLs that stay live as new threads land.

Try nlqdb in 30 seconds

No sign-in. The anonymous database lasts 72 hours; adopt it with one click if you keep it.

Start with a goal →

Looking at this from a different angle? Browse all solve pages or browse competitor comparisons.