The core idea: paste a query (or right-click a .sql file), get a visual flow diagram. Tables, joins, CTEs, subqueries — laid out as a graph. But visualization was just the starting point. The bigger goal was lineage .
Column-level lineage traces how each output column connects back to its source tables and transformations. SELECT a.name, b.total — where does `total` actually come from? Which table, which expression, through which CTEs? SQL Crack traces that chain and shows it. No warehouse metadata APIs needed, just the SQL text itself.
Workspace Dependencies takes it further. Right-click a folder, get cross-file lineage — which files read from which tables, how they connect, upstream/downstream dependencies. Impact analysis: what breaks if I drop this table? Rename this column? Where are the orphan definitions nobody reads from? All derived from static analysis of your SQL files.
This is the part that came from day-job pain. Single-query visualization is nice, but in real projects you have dozens of SQL files feeding into each other. One column rename can cascade silently. I wanted to see that before it hits production.
A few other things that might be interesting:
- Everything runs locally. VS Code extension processes in-editor, web playground parses in-browser. No SQL is uploaded anywhere.
- 13 SQL dialects. Oracle and Teradata don't have native parser support in node-sql-parser, so they route through proxy dialects (PostgreSQL and MySQL respectively) with preprocessing layers that rewrite dialect-specific syntax. Oracle needs 9 preprocessing transforms (CONNECT BY, MINUS→EXCEPT, PIVOT, flashback queries, MODEL clause, storage DDL, type rewrites, etc.). Teradata needs 22.
- renderer.ts hit 9,686 lines at one point. Multi-pass refactor brought it down ~63%. 2,000+ tests passing, no regressions.
- Built mostly after my toddler's bedtime on nights and weekends.
MIT licensed. No telemetry in the extension. The website uses Cloudflare Web Analytics (privacy-focused, no cookies). No monetization.
Web playground (no install): https://sqlcrack.com/playground VS Code: https://marketplace.visualstudio.com/items?itemName=buvan.sq... Cursor: https://open-vsx.org/extension/buvan/sql-crack GitHub: https://github.com/buva7687/sql-crack
Happy to answer questions about the lineage approach, parsing strategy, or the proxy dialect design.