I built QueryLens to visually map complex SQL queries step-by-step (No more reading raw execution logs!)

By (@thebuilderx) · · For Developers

I built QueryLens, a quick developer tool that takes complex SQL queries and translates them into clean, visual flowcharts right in your browser. Most database explain plans are a massive headache to read. QueryLens parses your raw SQL and lays out the steps in the actual logical order the database evaluates them (starting with FROM and JOINs first, down to SELECT and LIMIT). How it works: Visual Query Flows: Maps out your query logic as connected cards in a React Flow diagram. Synced Code & Visuals: Clicking a step in the flowchart jumps straight to that line in the Monaco SQL editor (and vice versa). Auto-Saved Drafts: If you click on the preset query samples to test things out, it automatically backs up whatever SQL you were writing so you can restore your draft instantly. Fully Offline: Runs entirely client-side, meaning your SQL code never leaves your computer. I built this with the help of an AI assistant to handle Monaco cursor events, React Flow node layouts, and to generate the branding assets. Let me know what you think!

Tech stack

  • Claude Code
  • Claude

Prompt

Build a premium, dark-mode React application using TypeScript, Vite, Monaco Editor, and React Flow that visualizes SQL query execution plans in their true logical evaluation order (FROM/JOIN ➔ WHERE ➔ GROUP BY ➔ HAVING ➔ SELECT ➔ DISTINCT ➔ ORDER BY ➔ LIMIT).

Implement the following design and technical requirements:
1. Two-Pane Split Layout: A resizable, split-pane workspace featuring the Monaco editor on the left and the React Flow diagram on the right, housed under a modern glassmorphic top header bar.
2. Bi-directional Interactive Sync: Link Monaco's cursor selection changes to React Flow nodes. Selecting a line in Monaco should highlight and focus the corresponding flow node, and clicking a diagram node should focus and highlight the matching line in Monaco.
3. Intelligent Draft Recovery: Maintain a history buffer state. If a user manually edits a query and then clicks one of the SQL preset samples, automatically back up their custom query draft and reveal a pulsing, primary "Restore Draft" button in the editor toolbar.
4. Spacing & No-Overlap Math: Position sibling nodes horizontally and level nodes vertically with safe coordinate margins to prevent node collisions and over…

Comments (5)

  1. mousedevv · · 3 likes

    this is so freaking cool. Gonna use this later for sure. Debugging / learning backend just got way eaiser holy cow! Amazing build!!

  2. viktor · · 2 likes

    <p>Exactly what I needed for complex queries. Awesome </p>

  3. Lateef · · 2 likes

    <p>No more staring at raw explain plans. QueryLens looks clean 🔥</p>

  4. Toney · · 2 likes

    <p>Perfect for devs. Nice work!</p>

  5. Jack Herzlich · · 1 like

    This goes hard 🔥 Really useful build. Great work Arqon!

22 likes · 5 comments · 27 views

Explore more on Prompted