Skip to content

builtbyzero/sql-plain

Repository files navigation

sql-plain

Explain any SQL query in plain English. Part of the builtbyzero lineup.

Paste a SQL query, get a structured plain-English explanation: SELECT clause, FROM/JOINs, WHERE filters, GROUP BY, ORDER BY, LIMIT — clause by clause. Powered by a real SQL parser (node-sql-parser), not regex guesses.

🔗 Live: https://sql-plain.builtbyzero.com (deploys via Cloudflare Pages / Vercel)


Features

Free (no signup)

  • Paste SQL → instant breakdown
  • Supports SELECT, INSERT, UPDATE, DELETE, CREATE TABLE
  • Syntax-highlighted editor (CodeMirror)
  • Copy explanation to clipboard (Markdown)
  • 3 starter examples
  • Mobile responsive, dark mode

Pro — $9/mo

  • 🔥 Performance hints — SELECT * warnings, missing-index heuristics, leading-wildcard LIKE, ORDER BY without LIMIT
  • 🌐 Dialect notes — MySQL vs PostgreSQL vs SQLite differences
  • 📊 Complexity score — 0–10 rating with actionable advice
  • 📤 Export — Markdown download + PDF print

Pro is currently stubbed; the upgrade button links to the builtbyzero product page. Stripe wiring coming soon.


Run locally

git clone https://github.com/builtbyzero/sql-plain
cd sql-plain
npm install
npm run dev
# open http://localhost:3000

Build

npm run build
npm start

Stack

  • Next.js 14 (App Router)
  • Tailwind CSS + custom theme (indigo→purple gradient)
  • CodeMirror 6 for the SQL editor
  • node-sql-parser for AST parsing
  • Framer Motion for animations
  • TypeScript end-to-end

How it works

lib/explain.ts walks the AST returned by node-sql-parser and produces a tree of ExplanationSections — one per SQL clause — plus a list of ProHints for the paid tier. The /api/explain route is a thin POST endpoint that runs the parser server-side (avoids shipping the parser to the client). The UI debounces input and re-renders with Framer Motion on each result.

License

MIT © builtbyzero

Related

About

Explain any SQL query in plain English. Free + Pro tier. Part of builtbyzero.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors