Skip to content

v2.5.0 — Saved queries and file export

Choose a tag to compare

@ikelaiah ikelaiah released this 20 Sep 22:31
· 23 commits to main since this release

ProcFlow v2.5.0 — Saved queries and file export

Released as the query-persistence milestone. The ERD query builder no longer
loses work when the tab closes, and the generated SQL can leave the browser as
a file. Everything remains local: one explicit saved slot per browser, plus
versioned files you own.

Highlights

  • Save to this browser, Restore saved, Forget saved. One query is stored
    under procflow.erd.query with explicit actions only — nothing is written
    automatically, matching the ERD layout and workspace rules. Activating query
    mode with a saved query and no picks points at Restore.
  • Versioned query files. Export query file writes a
    procflow-erd-query v1 JSON payload carrying the selections, taught joins,
    self-join copy routing, options, and a schema fingerprint. Import query
    file
    reads it back.
  • Download .sql. The statement is written as a file and respects the
    Comments toggle. The optional name field drives filenames
    (orders-by-customer.json / .sql); without it the schema fingerprint is
    used.
  • Prune-and-report restores. References that no longer exist — tables,
    columns, taught joins, sorts, cross/excluded ids, path choices — are dropped
    and counted, and a changed schema is named in the status line. Restores never
    fail because the schema moved on. Foreign formats, future versions, and
    malformed JSON are rejected with diagnostics.
  • Pure store module. src/query-store.ts owns serialization, validation,
    and pruning with no DOM or storage access; schemaFingerprint moved to
    src/schema.ts and is shared with ERD layout files. Browser storage stays in
    the CI-guarded src/workspace.ts.
  • Documentation. ADR-002 records the persistence decisions and rejected
    alternatives; docs/QUERY_BUILDER.md gains the file format and drift
    semantics; ARCHITECTURE adds invariant 7.

Accuracy and limits

  • No analysis or join semantics changed. Joins still use declared foreign-key
    evidence only; taught joins and self-join copies remain labelled not
    declared; the generated SQL stays read-only.
  • One saved query per browser by design; keep multiple analyses as files. See
    ADR-002 for why a named library was deferred.
  • Saved queries and ERD layouts are independent storage keys; forgetting one
    never drops the other.

Verification

The final local verification recorded for this release includes:

  • golden browser assertions on tests/index.html passing (221/221), including
    the query-store records for deterministic round-trip, three rejection codes,
    unreadable-entry tolerance, stale pruning with reasons, fingerprint
    stability, export naming, and the opt-in storage round-trip;
  • the ERD query UI suite passing 62/62 over HTTP (query mode, picking, join and
    problem cards, teaching, self joins, options, highlighting, resize, Find,
    only-used filter, export/import/download, and browser save/restore/forget);
  • the Firefox smoke page passing 10/10 critical paths;
  • npm run typecheck, npm run build, npm run test:file, npm run metrics,
    npm run package:smoke, and npm run benchmark passing;
  • runtime archive structure and local-file startup smoke passing
    (procflow-v2.5.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; saved
queries are a new key and do not affect them.