Understand complicated SQL without tracing every branch by hand.
proc>flow is a local-first SQL logic and dependency visualiser for database
administrators, SQL report engineers, developers, analysts, and reviewers.
Paste SQL or import a group of SQL files to see:
- how a procedure, function, trigger, view, or query works internally; and
- how database objects read, write, and call one another.
There is no installation, database connection, backend service, or sign-in. The application runs entirely in a browser and works from the local filesystem.
Important
ProcFlow uses a heuristic parser rather than a database engine's compiler. Treat diagrams as investigation aids. Check important findings against the source SQL and the target database.
For the first stable release, see RELEASE_NOTE_v1.0.0.md.
| I want to… | Go to |
|---|---|
| Open ProcFlow and try it now | 60-second quick start |
| Review a stored procedure, function, or trigger | Workflow for DBAs |
| Understand a report or dataset query | Workflow for SQL report engineers |
| Understand confidence, coverage, and warnings | Reading the analysis safely |
| Check privacy or prepare a security review | Security and privacy |
| Build, test, or change the project | Developer guide |
| Prepare a release | Release checklist |
- Download the
v1.0.0archive from GitHub Releases or clone this repository. - Extract the complete archive. Keep
index.html,styles.css,dist/, andvendor/together. - Open
index.htmlin a recent Chrome, Edge, Firefox, or Chromium browser. - Choose one input:
- press Load sample;
- paste SQL into SQL source; or
- press Import SQL files and select one or more files.
- Press Refresh or use
Ctrl+Enter(Cmd+Enteron macOS).
No npm install, local server, database, or internet connection is required
for normal use.
If the page opens but the diagram does not render, first confirm that the whole
archive was extracted. Opening a copied index.html without its sibling
dist/ and vendor/ directories will not work.
Use ProcFlow to shorten the first pass through unfamiliar routines and change reviews.
- Import the relevant
.sql,.ddl, or.txtfiles. - Set Scope to Object dependencies to see routine calls and table reads/writes across the imported files.
- Select a known object in the diagram or use the Object selector.
- Set Scope to Internal logic.
- Use View → Control flow for branches, loops, transactions, exits, and error paths.
- Check Confidence, Coverage, and Diagnostics before relying on the chart.
- Click a source-aware diagram node to select its SQL in the editor.
- Use Export to save SVG or editable draw.io XML when the diagram is ready to share.
Useful DBA review questions include:
- Which tables are read or changed?
- Which routines are called?
- Can execution exit before a commit or final result?
- Where can an exception or error be handled, rethrown, or terminate work?
- Does transaction state affect the available recovery path?
- Is any dynamic SQL hiding behavior from static analysis?
When automatic dialect detection is uncertain, select the dialect explicitly and refresh the analysis.
Use ProcFlow to understand report datasets, extracts, views, and large SELECT statements.
- Paste the dataset query or import its SQL file.
- Leave View on Auto, or choose Query structure explicitly.
- Review CTEs, source tables, explicit joins, unions, subqueries, filtering, and grouping.
- Turn Source tables on or off to adjust the amount of detail.
- For several views or queries, use Object dependencies to see shared sources and upstream objects.
- Check Coverage and Diagnostics, especially for vendor-specific table expressions or comma-separated sources.
- Export the result as SVG or draw.io when documenting a report or handing analysis to another engineer.
ProcFlow imports SQL text, not report-definition files. SSRS/RDL import is on the roadmap; for v1.0.0, paste or export the dataset SQL itself.
IF,ELSE, andCASEdecisions- loops, loop exits, and early returns
- statements and result sets
- procedure and function calls
- table reads and writes
- temporary-table transformations
- transactions and savepoints
- exception handling and T-SQL
TRY/CATCH - dynamic SQL as an explicit opaque step
- common table expressions
- source tables and views
- explicit joins
- unions
- subqueries
- filtering
- grouping
- procedure or function → called routine
- view or query → source object
- object → table read
- object → table write
Known imported objects are linked. Selecting one can open its internal logic.
The analysis panel provides three release-safety signals:
- Confidence combines dialect certainty, parser coverage, and diagnostics.
- Coverage is the percentage of body tokens consumed by the parser.
- Diagnostics reports uncertain dialects, balance errors, missing block terminators, unconsumed input, invalid actions, and opaque dynamic SQL.
Use this rule of thumb:
- High confidence and complete coverage: review the chart, then verify material findings in the SQL.
- Reduced confidence: select the dialect manually and inspect the diagnostics.
- Incomplete coverage: treat the unresolved source region as a review item.
- Dynamic SQL warning: review the generated SQL separately; its internal reads, writes, calls, and branches cannot be inferred safely.
Input the parser cannot consume is represented as an unresolved node rather than silently disappearing from the diagram.
ProcFlow v1.0.0 recognises:
- Microsoft T-SQL
- IBM DB2 SQL PL
- PostgreSQL PL/pgSQL
- SQLite
Supported inputs include procedures, functions, triggers, views, plain SQL statements, report dataset queries, and multi-object scripts where those object types apply to the selected dialect.
Dialect-specific v1.0.0 coverage includes:
- T-SQL:
TRY/CATCH,THROW,RAISERRORseverity,XACT_STATE(),@@TRANCOUNT, nested transaction depth, savepoints,SET XACT_ABORT, and invalid transaction-action termination. - DB2 SQL PL: scoped handlers, cursors,
NOT FOUNDflow, and labelled loop control. - PL/pgSQL:
EXCEPTIONcondition matching, transactional exception scopes, and rethrow propagation. - SQLite: trigger
RAISEactions, termination behavior, triggerWHEN, conditionalWHERE, and searchedCASEpaths.
Detection is automatic and can be overridden from the Dialect selector.
Import SQL files accepts multiple .sql, .ddl, and .txt files. Files
are read into memory by the current browser tab; they are not uploaded or
persisted.
Multi-object scripts are split into selectable objects. If the split cannot be made confidently, ProcFlow keeps the input as one script and reports the uncertainty.
The Export menu provides:
- Copy Mermaid — copy the generated Mermaid definition.
- Copy narration prompt — copy a prompt containing diagram structure and source SQL.
- Save SVG — download the rendered diagram.
- Save draw.io — download editable native
.drawioXML.
The narration prompt is never submitted automatically. It reaches another system only if a user pastes it there. Review organisational policy before sharing confidential SQL.
draw.io is a trademark of draw.io AG. ProcFlow is not affiliated with or endorsed by draw.io.
| Question | ProcFlow v1.0.0 behavior |
|---|---|
| Is SQL uploaded? | No. Analysis and rendering happen in the browser tab. |
| Does it connect to a database? | No. There is no driver, connection string, or query execution. |
| Is there a backend or API? | No. It is a static HTML, CSS, and JavaScript application. |
| Is there analytics or telemetry? | No. |
| Is internet access required? | No for local or internally hosted use. |
| Are imported files uploaded? | No. The browser File API reads them into the current tab. |
| Is SQL retained after closing the tab? | No. ProcFlow does not use cookies, localStorage, sessionStorage, or IndexedDB. |
| Does ProcFlow write to the clipboard automatically? | No. Clipboard writes follow an explicit copy action. |
| Are exports local? | Yes. SVG and draw.io files are generated in memory and downloaded by the browser. |
| Does it call an AI service? | No. It can copy a narration prompt but never submits it. |
The runtime application consists of:
index.html
styles.css
dist/src/tokenizer.js
dist/src/dialects.js
dist/src/lineage.js
dist/src/ir.js
dist/src/exporters.js
dist/src/app.js
vendor/mermaid/mermaid.min.js
There is no application fetch, XMLHttpRequest, WebSocket, beacon, or other
network-submission code. The only bundled third-party runtime is the pinned
Mermaid 10.9.1 renderer. Its MIT licence is stored at
vendor/mermaid/LICENSE.
The SHA-256 of vendor/mermaid/mermaid.min.js in v1.0.0 is:
61B335A46DF05A7CE1C98378F60E5F3E77A7FB608A1056997E8A649304A936D6
The repository's .gitattributes preserves this vendored file byte-for-byte
so the release checksum remains reproducible across operating systems.
- Review and pin the
v1.0.0tag or its exact commit. - Verify the vendored Mermaid checksum.
- Review the runtime files listed above.
- Open the reviewed files locally or serve them from an approved internal static host.
- Keep browser extensions and developer tools within organisational policy.
- Re-review runtime and dependency changes before upgrading.
- Apply the organisation's Content Security Policy at the hosting layer when serving ProcFlow over HTTP.
If ProcFlow is served through GitHub Pages or another host, that host receives ordinary web-request metadata while serving the static files. ProcFlow still does not place entered SQL in those requests. Organisations that do not permit public hosting should use the release files locally or on an internal static server.
The primary deliberate data-release action is Copy narration prompt. It places SQL and diagram structure on the clipboard. Users remain responsible for where that information is pasted or saved.
No browser application can guarantee the security of the host computer, browser, installed extensions, modified source files, or external destination. ProcFlow's boundary is that its own application code performs analysis locally and contains no automatic data-submission path.
- Parsing is heuristic and does not provide the guarantees of the target database engine's parser.
- Dynamic SQL is opaque.
- Semicolon-free or unusually formatted batches can produce inaccurate statement boundaries.
- Query lineage is object-level rather than column-level.
- Comma-separated sources and some vendor-specific table expressions might not be detected.
- Temporary-table, synonym, linked-server, and cross-database resolution is lightweight.
- SSRS/RDL files are not imported in v1.0.0.
- Large draw.io exports can require manual rearrangement.
Always confirm critical dependencies, execution paths, transaction behavior, and security conclusions against the original SQL and target database.
- Node.js 22 is recommended and is the CI baseline.
- npm, included with Node.js.
- A recent Chrome, Edge, or Chromium browser for the local-file smoke test.
- Python 3 is optional and is used only for the simple manual test server shown below.
git clone https://github.com/ikelaiah/ProcFlow.git
cd ProcFlow
npm ci
npm run typecheck
npm run build
npm run test:file
npm run test:file opens the real index.html through a file:// URL in a
headless Chromium browser and verifies that the page and all local runtime
scripts initialise. The runner automatically looks for Chrome, Edge, or
Chromium. If the browser is installed in a non-standard location, set
CHROME_PATH to its executable.
Make source changes in src/ or tests/. npm run build compiles TypeScript
into browser-ready JavaScript and source maps under dist/.
dist/ is committed deliberately so an end user can open index.html without
installing a toolchain. After source changes:
npm run typecheck
npm run build
git status --short
Commit the matching generated dist/ files with their TypeScript sources.
Start a local static server from the repository root:
python -m http.server 8000
Then open:
http://127.0.0.1:8000/tests/index.html— golden parser, graph, dependency, and exporter testshttp://127.0.0.1:8000/tests/fuzz.html— deterministic mutation and invariant testshttp://127.0.0.1:8000/tests/ui.html— browser interaction and local-runtime tests
The v1.0.0 baseline is:
- 131 focused golden tests
- 400 deterministic mutation cases
- 12 browser interaction tests
GitHub Actions installs dependencies, type-checks, builds, verifies generated files, runs the local-file smoke test, checks that the runtime remains local-only, and runs all three served browser suites on every push and pull request.
index.html
styles.css
README.md
RELEASE_NOTE_v1.0.0.md
package.json
package-lock.json
tsconfig.json
.gitattributes
.github/
└── workflows/
└── correctness.yml
assets/
└── procflow-logo.svg # adaptive light/dark README wordmark
scripts/
└── file-smoke.mjs # dependency-free local-file release smoke test
src/
├── types.d.ts # shared tokens, AST, graphs, diagnostics, and contracts
├── tokenizer.ts # lexical analysis, escaping, balance checks, source spans
├── dialects.ts # dialect detection and procedural parsing
├── lineage.ts # CTE and query dependency extraction
├── ir.ts # graphs, diagnostics, and estate analysis
├── exporters.ts # Mermaid, draw.io, and narration output
└── app.ts # browser UI and workspace interaction
dist/ # generated JavaScript and source maps
├── src/
└── tests/
tests/
├── index.html
├── fuzz.html
├── ui.html
├── fixtures.ts
├── tests.ts
├── fuzz.ts
├── ui-tests.ts
└── dialects/
├── db2.ts
├── tsql.ts
├── plpgsql.ts
└── sqlite.ts
vendor/
└── mermaid/
├── mermaid.min.js
└── LICENSE
The shared model uses a discriminated TypeScript AST and records source spans, branches, loops, scoped handlers, reads, writes, calls, result sets, diagnostics, and graph structures.
Run the following from a clean checkout before tagging a release:
npm ci
npm run typecheck
npm run build
npm run test:file
git status --short
Then verify:
- The three served browser suites pass.
git status --shortshows only the intended release changes.- Generated
dist/files match their TypeScript sources. - The Mermaid SHA-256 matches the value in this README and the workflow.
RELEASE_NOTE_v1.0.0.mdmatches the final tag contents.- The complete archive opens locally with
index.html. - The tag is named
v1.0.0.
The release can then be created manually from the v1.0.0 tag using
RELEASE_NOTE_v1.0.0.md.
- Expand the anonymised golden SQL fixture corpus.
- Improve table-function,
APPLY, comma-source, and DML lineage. - Model more multi-statement and temporary-table transformations.
- Import SSRS/RDL definitions and link reports to datasets.
- Accept database catalogue metadata for more accurate object resolution.
- Add column-level lineage where it can be resolved safely.
- Add optional local workspace persistence and dependency filtering.
- Separate graph, transaction, and estate-analysis internals while preserving the v1.0.0 behavior through golden tests.
A useful bug report includes:
- the selected and detected dialect;
- a minimal anonymised SQL example;
- the generated Mermaid source;
- the expected control flow or dependency;
- the reported confidence, coverage, and diagnostics; and
- the browser and version.
For parser changes, add a focused fixture that fails before the change and passes afterward. Run type-checking, the build, the local-file smoke test, and the relevant browser suites before opening a pull request.
Never include production credentials, confidential data, or SQL that cannot be shared safely in a public issue.