Skip to content
● correctness-first · offline-first · postgresql

Explain your PostgreSQL query, and know it’s right before you make it fast.

npm 0.2.1ci passingmit licensepostgresql
sqlsage demo
offline · no db
$ npm install --global sqlsage && sqlsage demo
▸ parsing query .......... done
▸ binding to catalog ...... done
grain    1 row per (customer_id, order_id)
shape    Seq Scan → Hash Join → Sort
⚑ wrong-result risk evidence: plan-observed
NOT IN excludes all rows when customer_id
contains any NULL — silently returns 0 rows
→ rewrite to NOT EXISTS evidence: predicted
report  written → sqlsage-report.json
$

-- what it does

correctness
Correctness before speed

A query that silently returns the wrong rows matters more than one that's merely slow — wrong-result risks are flagged first.

explain
Plain-English explanations

Result grain, execution shape, and risk — described in words, with the exact SQL and column behind each finding.

evidence
Honest evidence labels

Every claim is predicted, plan-observed, measured, or unverified. Nothing over-promises.

offline
Works completely offline

Analyze with just schema or catalog metadata. A database connection is optional, and never required.

actionable
Explicit change sets

Conservative index recommendations and rewrites — never executed silently, always reviewable.

json
Machine-readable output

An evidence bundle you can replay and compare across captures, in text, markdown, or JSON.

MIT licensed · Analyzes PostgreSQL SELECT statements with an honest evidence model.