Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ jobs:
- name: Check runtime remains local-only
shell: bash
run: |
if grep -REn "https?://" index.html styles.css src dist tests; then
# The W3C SVG namespace is an XML identifier passed to createElementNS,
# not a network URL: allow exactly that string and fail on any other.
if grep -REn "https?://" index.html styles.css src dist tests \
| grep -v "http://www.w3.org/2000/svg"; then
echo "Runtime files contain an external URL."
exit 1
fi
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable released ProcFlow changes are recorded here. Detailed verification
evidence belongs in the canonical release note under `docs/releases/`.

## v2.1.0 — Entity relationship diagrams

- Added the ERD page (`erd.html`): DDL parsing for declared tables, views,
columns, primary/unique/foreign keys, and composite-key grouping across
T-SQL, PostgreSQL, DB2, and SQLite, with raw type fidelity and source spans.
- Added deterministic Mermaid `erDiagram` export with declared cardinality,
optionality, and provenance comments. Declared constraints only; unresolved
references stay explicit.
- Added estate navigation: canvas panning, draggable tables, FK selection
inspector, find/jump, compact boxes for large estates, and smooth wheel zoom
with whole-estate Fit.
- Added a draggable editor/diagram divider on both pages and a clear
Flowchart/ERD page switcher.
- Fixed view cards being hidden by a global class collision and Fit zooming
out indefinitely on large estates.

## v2.0.0 — Trustworthy SQL Analysis Contract

- Added the cross-dialect adversarial semantic qualification matrix and its
Expand Down
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
</p>

ProcFlow turns SQL into diagrams for control flow, query structure, object
dependencies, column lineage, and report dependencies. It runs locally in the
browser: no backend, database connection, sign-in, or installation is required.
dependencies, column lineage, report dependencies, and entity relationship
diagrams from schema DDL. It runs locally in the browser: no backend, database
connection, sign-in, or installation is required.

> **Accuracy warning:** ProcFlow is a deterministic heuristic analyser, not a
> database compiler. Treat diagrams as investigation aids and verify important
Expand All @@ -33,6 +34,9 @@ browser: no backend, database connection, sign-in, or installation is required.
their queries, and trace report → dataset → object → column dependencies.
- **Application teams:** inspect multi-object scripts, temporary-table flow,
catalogue-backed object resolution, and conservative column lineage.
- **Schema reviewers:** open `erd.html`, paste or import `CREATE TABLE` /
`ALTER TABLE` DDL, and see declared tables, views, keys, and foreign keys as
an entity relationship diagram.
- **Reviewers:** export deterministic Mermaid, SVG, or editable draw.io
diagrams with source provenance.

Expand All @@ -45,6 +49,24 @@ browser: no backend, database connection, sign-in, or installation is required.
4. Choose an object and scope, then inspect the source spans and diagnostics
before relying on a relationship.

For schema DDL, open `erd.html`, paste or import `CREATE TABLE` / `ALTER TABLE`
statements (T-SQL, PostgreSQL, DB2, or SQLite), and review the declared
entities and foreign keys. Drag the canvas to pan, drag a table card to move it
out of the way and declutter relationship lines (double-click a card, or use
**Reset layout**, to restore the grid), select a table to highlight its
declared foreign keys and list each one with its column mapping and
cardinality, and press **Clear** (or Escape) to deselect. Zoom controls under
the canvas (or **Fit**) frame the whole estate; with a table selected, **Fit**
frames that table and its declared neighbours and the selection ring stays
visible at estate zoom. On both the flowchart
and ERD pages the divider between the editor and the diagram is draggable
(double-click it to reset). Estates with hundreds of tables stay responsive:
auto-draw pauses above the shared large-input threshold until **Refresh**,
boxes switch to a compact summary automatically, and **Find** highlights
matches and jumps between them with Enter. The ERD page asserts declared
constraints only; it never infers a relationship from query text, and
unresolved references stay explicit.

For development, see [Development](docs/DEVELOPMENT.md). For a simple served
run, use `python -m http.server 8000` from the runtime directory and open
`http://127.0.0.1:8000/`.
Expand All @@ -66,6 +88,9 @@ in the browser.
- temporary-table producer → consumer data flow;
- conservative column lineage with explicit ambiguity;
- report and dataset dependency chains;
- declared entity relationships from DDL: tables, views, columns, primary,
unique, and foreign keys (composite keys grouped), exported as Mermaid
`erDiagram`;
- dynamic SQL as an explicit opaque step rather than an invented dependency.

## Supported dialects
Expand Down
282 changes: 282 additions & 0 deletions dist/src/erd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading