Repository navigation
v2.4.0 — Query builder on the ERD
ProcFlow v2.4.0 — Query builder on the ERD
Released as the ERD query-builder milestone. The declared-constraint model now
produces runnable SQL: pick columns on the diagram and ProcFlow works out the
joins the DDL actually declares, shows the plan, and hands you the statement to
run in your database client.
Highlights
- Query builder on the diagram. A toolbar toggle turns every column row
into a checkbox and opens a floating window that can be dragged, resized
(corner grip or arrow keys), and collapsed. Picked rows are highlighted,
cards carry a picked-count badge, and the floating window can be closed and
reopened with the picks intact. - Declared-evidence joins only. Shortest paths over declared foreign keys
connect the picked tables, preferring exact resolutions over name-matched
ones. Bridge tables are included, tagged, and never selected. Optional and
parent→child traversals use LEFT by default in the preserve policy; every
join has an INNER/LEFT switch and a plain-language note about direction,
optionality, and row multiplication. - Equal-cost paths are a choice, not a guess. When two declared paths reach
the same table (for exampleCreatedByandApprovedBy), the plan shows
both paths and the first declaration is used until you pick another. - Unjoinable picks are explicit. Tables with no declared path get a coral
ring and a problem card. Resolve by teaching the join (column pair, typed
predicate, or click two columns on the diagram), opting into aCROSS JOIN,
or leaving the columns out — the provenance header names anything omitted.
ProcFlow never silently produces a cartesian product. - Self joins. Clicking two columns of the same table creates a second
aliased copy; tick which picked columns read from that copy, and the header
documents the alias assecond copy, self join. - Query ergonomics. Dialect-aware
DISTINCT, a row cap (TOP n/LIMIT n
/FETCH FIRST n ROWS ONLY), and per-column sort cycling (ascending →
descending → off) on the picked-column chips. A tip offersDISTINCTwhen a
one-to-many join can repeat rows. - Readable generated SQL. Dependency-free syntax highlighting (keywords,
comments, strings, identifiers, numbers, punctuation) where the concatenated
token text is byte-identical to the emitted SQL; Copy always copies the raw
text. Dialect quoting covers T-SQL, PostgreSQL, DB2, and SQLite. - Diagram and plan stay one surface. Plan edges draw at full strength while
unrelated edges dim; hovering a join card lights its exact edge and both
endpoint cards; Only used tables narrows the canvas to the query plus any
unresolved tables; Find now matches columns and highlights the exact
rows; hover and teaching cursors make the diagram the picker.
Accuracy and limits
- Joins use declared
PRIMARY KEY/UNIQUE/FOREIGN KEYevidence only.
Column names never imply a relationship. - Taught joins, self-join aliases, and
CROSS JOINopt-ins are labelled as not
declared in the plan and in the SQL header; ProcFlow states that it cannot
verify them. - Name-matched foreign-key targets remain usable with a warning; external
(unresolved) targets cannot be picked and are explained in the picker notes. - The generated SQL is read-only and derived. Edit it where you run it.
- Query picks and options are session state; only ERD layouts persist (opt-in).
Verification
The final local verification recorded for this release includes:
npm run typecheck,npm run build,npm run test:file, and
npm run metricspassing;- golden browser assertions on
tests/index.htmlpassing (221/221), including
the v2.4.0 query-builder suite (39/39: join graph and pathfinding, ambiguity
alternatives, bridges, preserve/strict policy, taught joins, self joins,
disconnected selections, dialect quoting, ergonomics options, highlighting
token round-trip, and deterministic output); - a scripted headless UI pass over
erd.htmlpassing 67/67 interaction checks
(query mode, on-card picking, join and problem cards, teaching by clicks,
self-join copy routing, resize and keyboard resize, highlighting, chips,
Find and the only-used filter); - runtime archive structure and local-file startup smoke passing
(procflow-v2.4.0.zip).
Upgrade and distribution
The runtime is self-contained. Use npm run package:runtime to produce the
versioned ZIP and verify .release/SHA256SUMS.txt before distributing it.
Layouts and layout files saved by earlier releases remain readable; query
builder state is not persisted between sessions.