See what your SQL actually does.
QueryFlow is a browser-based SQL visualization tool that turns a SQL query into a visual execution flow. Instead of only showing the final rows, it helps you follow the tables, operations, row changes, and final projection that lead to the result.
SQL tells you what to ask for. QueryFlow focuses on how the result is produced.
A query such as:
SELECT users.name, orders.total
FROM users
JOIN orders ON users.id = orders.user_id
WHERE orders.total > 100;becomes a visual sequence:
ββββββββββ βββββββββ βββββββββ ββββββββββ ββββββββββ
β FROM β ββββΆ β JOIN β ββββΆ β WHERE β ββββΆ β SELECT β ββββΆ β RESULT β
ββββββββββ βββββββββ βββββββββ ββββββββββ ββββββββββ
β β β β β
βΌ βΌ βΌ βΌ βΌ
source rows matched rows removed rows new shape final rows
The goal is to make the execution of a query easier to see, inspect, and understand.
- Syntax-aware SQL presentation
- Preloaded example queries
- Run and Step controls
Ctrl/Cmd + Enterexecution shortcut- Query preset selector
- Reset support
- Built-in
USERSandORDERStables - Visible column structure
users.id β orders.user_idrelationship- Active-table highlighting during execution
- JOIN relationship emphasis
The central QueryFlow experience is a horizontal execution rail:
FROM β JOIN β WHERE β SELECT β RESULT
Each stage represents a meaningful operation and updates the surrounding evidence shown in the interface.
At filtering stages, QueryFlow makes the effect of the condition visible.
For example:
id name age
ββββββββββββββββββββ
1 Ahmed 17 excluded
2 Sara 22 included
3 Omar 25 included
4 Ali 16 excluded
5 Mona 31 included
The interface can show exactly which records continue through the pipeline and which records are removed.
The explanation panel follows the selected pipeline stage and translates the operation into plain language.
The final result is presented as the conclusion of the execution flow, with the relationship between the intermediate states and final projection kept visible.
| Area | Technology |
|---|---|
| UI | React |
| Language | TypeScript |
| Build tool | Vite |
| Styling | Tailwind CSS |
| Testing | Vitest + Testing Library |
| Icons | lucide-react |
| SQL runtime | Browser-side architecture, prepared for SQLite/WASM |
| Rendering | React + CSS/SVG |
| Backend | None |
QueryFlow is designed as a browser-only application for the MVP. The execution layer is isolated behind an adapter so a real SQLite/WASM implementation can be introduced without coupling SQL APIs to the UI.
The project keeps SQL execution, visualization, and presentation separate:
ββββββββββββββββββββββββββββββββ
β SQL Editor β
ββββββββββββββββ¬ββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β SQL Parser β
ββββββββββββββββ¬ββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Execution / Adapter Layer β
ββββββββββββββββ¬ββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Visualization Step Generator β
ββββββββββββββββ¬ββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β QueryFlow UI β
ββββββββββββββββββββββββββββββββ
Visualization is represented with structured step data rather than being hard-coded into individual components.
A step can contain:
type VisualizationStep = {
id: string;
operation: string;
label: string;
description: string;
detail: string;
condition?: string;
inputRows: unknown[];
outputRows: unknown[];
removedRows: unknown[];
columns: string[];
relatedTables?: string[];
};This keeps the UI focused on displaying execution evidence while the SQL layer remains replaceable.
queryflow/
βββ src/
β βββ components/
β β βββ AppHeader.tsx
β β βββ ExplanationPanel.tsx
β β βββ PipelineRail.tsx
β β βββ PipelineStage.tsx
β β βββ ResultsTable.tsx
β β βββ RowMatrix.tsx
β β βββ SchemaGraph.tsx
β β βββ SqlEditor.tsx
β β
β βββ data/
β β βββ demoQuery.ts
β β
β βββ hooks/
β β βββ usePipeline.ts
β β
β βββ lib/
β β βββ demoExecutionAdapter.ts
β β
β βββ types/
β β βββ query.ts
β β
β βββ App.tsx
β βββ index.css
β
βββ package.json
βββ vite.config.ts
βββ README.md
- Node.js 18+
- npm
npm installnpm run devVite will start the local development server and print the local URL in your terminal.
npm test -- --runnpx tsc -bnpm run lintnpm run buildThe current foundation has been validated with:
- 20 automated tests
- TypeScript compilation
- ESLint
- Production build
- Browser-based viewport checks
- Desktop, tablet, and mobile render verification
- Pipeline interaction checks
- WHERE row exclusion checks
- Run-to-result behavior
- Step navigation and restart behavior
The UI has also been exercised at:
1440pxdesktop900pxtablet390pxmobile
QueryFlow ships with a small relational dataset so the experience works immediately.
| id | name | age | |
|---|---|---|---|
| 1 | Ahmed | ahmed@example.com | 17 |
| 2 | Sara | sara@example.com | 22 |
| 3 | Omar | omar@example.com | 25 |
| 4 | Ali | ali@example.com | 16 |
| 5 | Mona | mona@example.com | 31 |
| id | user_id | product | total |
|---|---|---|---|
| 1 | 2 | Keyboard | 150 |
| 2 | 3 | Mouse | 80 |
| 3 | 2 | Monitor | 500 |
| 4 | 5 | Laptop | 1200 |
The relationship is:
users.id ββββββββββββββΆ orders.user_id
The initial product is intentionally focused on a small, highly visual SQL surface.
SELECTFROMWHEREJOINON
ORDER BYLIMIT- Multiple JOINs
GROUP BYHAVING- Aggregate functions such as
COUNT,SUM, andAVG - Subqueries
- CTEs
UNION- Additional JOIN types
The project prioritizes clear visualization of supported operations over broad SQL coverage.
QueryFlow follows a few simple UI rules:
Show evidence. Every important execution stage should have visible data behind it.
Keep the SQL central. The UI exists to explain the query, not compete with it.
Use motion for meaning. Animation should communicate state changes, not decorate the screen.
Stay dense but readable. Query tools benefit from information density when hierarchy is clear.
Prefer restraint. Borders, color, radius, and shadows should support the data flow rather than become the visual focus.
Contributions are welcome as the project evolves.
Before opening a pull request:
npm test -- --run
npm run lint
npx tsc -b
npm run buildFor UI changes, also verify the affected states at desktop and mobile widths.
This project is licensed under the MIT License.
Built with React, TypeScript, and a lot of SQL.