SQL Crack: Visualize SQL Queries as Interactive Flow Diagrams

⬅️ Back to Tools

SQL Crack: See Your SQL Queries Come to Life

If you’ve ever stared at a complex SQL query with multiple CTEs, JOINs, and subqueries and thought “what on earth is actually happening here?”, SQL Crack https://github.com/buva7687/sql-crack is about to become your new best friend. This VS Code extension transforms any SQL query into an interactive execution flow diagram, so you can see exactly how your query processes data, step by step.

Think of it like a visual debugger for your SQL, inspired by JSON Crack and Snowflake Query Profile.

Key Features

📊 Query Visualization

See your SQL in a whole new way:

  • Execution Flow - Watch how your query executes step-by-step with color-coded operation nodes
  • Multi-Query Support - Visualize multiple statements with tab navigation (Q1, Q2, Q3…)
  • Column Lineage - Click any output column to trace its transformation path through JOINs, aggregations, and calculations
  • CTE & Subquery Expansion - Double-click to expand CTEs and subqueries in floating cloud panels with independent pan/zoom
  • Query Compare Mode - Compare baseline vs. current query side-by-side with added/removed/changed node highlights
  • Query Statistics - Complexity score, CTE depth, fan-out analysis, and performance score (0-100)

Color-Coded Node Types:

  • 🟦 Table (Blue) - Source tables
  • 🟪 Filter (Purple) - WHERE clauses
  • 🩷 Join (Pink) - JOIN operations
  • 🟨 Aggregate (Amber) - GROUP BY, aggregations
  • 🩷 Window (Fuchsia) - Window functions
  • 🟩 Sort (Green) - ORDER BY
  • 🟦 Limit (Cyan) - LIMIT/TOP
  • 🟪 CTE (Purple) - Common Table Expressions
  • 🟩 Result (Green) - Final output

🌍 Workspace Analysis

Analyze cross-file dependencies across your entire SQL project:

Graph View - Dependency graph showing file and table relationships with color-coded edges for SELECT, JOIN, INSERT, UPDATE, and DELETE operations

Lineage View - Explore data lineage across tables, views, and CTEs with animated flow edges, mini-map navigation, and upstream/downstream focus modes

Impact Analysis - Analyze change impact (MODIFY/RENAME/DROP) with severity indicators and transitive impact paths

🧠 Smart Analysis

Get actionable insights to improve your queries:

  • Quality Warnings - Unused CTEs, dead columns, duplicate subqueries, repeated table scans
  • Performance Hints - Filter pushdown suggestions, join order optimization, index recommendations, non-sargable expression warnings
  • Performance Score - 0-100 score based on detected anti-patterns

Performance Indicators:

  • ⬆ Filter Pushdown - Filter can be applied earlier
  • 🚫 Non-Sargable - Expression prevents index usage
  • ⇄ Join Order - Suggestion to reorder joins
  • 📇 Index Suggestion - Missing index opportunity
  • 🔄 Repeated Scan - Table scanned multiple times
  • 🧮 Complex - High complexity warning

🗺️ Interactive Navigation

Navigate your queries like a pro:

  • Click to Navigate - Click nodes to jump to SQL source
  • Breadcrumb Trail - Navigate through nested CTEs with clickable breadcrumbs
  • Search - Find nodes by name with Cmd/Ctrl + F
  • Editor Sync - Bidirectional highlighting between editor and flow diagram
  • Hover Tooltips - Detailed information on hover

🎨 Layout & Export

Customize your view:

  • Layout Picker - Vertical, horizontal, compact, force, or radial layouts
  • Auto-Refresh - Updates automatically as you edit
  • Export Options - PNG, SVG, Mermaid.js, or clipboard copy
  • Fullscreen - Press F for distraction-free viewing

Supported Dialects

SQL Crack supports 11 major SQL dialects:

MySQLPostgreSQLSQL ServerMariaDBSQLiteSnowflakeBigQueryRedshiftHiveAthenaTrino

The extension automatically detects dialect-specific syntax and retries parsing with the correct dialect when needed.

Platforms

  • 🖥️ Windows
  • 🍎 macOS
  • 🐧 Linux

Get Started

Installation

Option 1: VS Code Marketplace (Recommended)

  1. Open VS Code
  2. Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
  3. Search for “SQL Crack”
  4. Click Install

Option 2: Build from Source

git clone https://github.com/buva7687/sql-crack.git
cd sql-crack
npm install
npm run package

# Install the generated .vsix file
# Extensions → ••• → Install from VSIX

Usage

Quick Start:

  1. Open any .sql file
  2. Visualize using one of:
    • Click the graph icon in the editor title bar
    • Press Cmd+Shift+L (Mac) / Ctrl+Shift+L (Windows/Linux)
    • Right-click → “SQL Crack: Visualize SQL Query”

Workspace Analysis:

  1. Right-click folder → “SQL Crack: Analyze Workspace Dependencies”
  2. Or run from Command Palette → “SQL Crack: Analyze Workspace Dependencies”

Keyboard Shortcuts:

ShortcutAction
Cmd/Ctrl + Shift + LOpen visualization
Cmd/Ctrl + FSearch nodes
CToggle column lineage
LToggle legend
HCycle layout
1-5Jump to specific layout
EExpand/collapse all CTEs
FToggle fullscreen
[ / ]Previous/next query

🔗 GitHub: github.com/buva7687/sql-crack

Why This Tool Rocks

  • Visual Clarity - Transform complex SQL into readable flow diagrams that make sense
  • Column Lineage - Trace exactly how each output column is calculated through your entire query
  • Workspace-Wide Analysis - Understand dependencies across your entire SQL project, not just single files
  • Performance Insights - Get actionable hints to optimize your queries before they hit production
  • Multi-Dialect Support - Works with 11 major SQL dialects including Snowflake, BigQuery, and PostgreSQL
  • Query Comparison - Compare versions of queries to spot changes at a glance
  • 100% Local - All processing happens in VS Code; your SQL never leaves your machine
  • No Telemetry - Zero data collection, fully auditable open source code
  • Accessibility - ARIA labels and keyboard navigation support for screen readers

Crepi il lupo! 🐺