pf_app
Go to file
Paul Trowbridge 1ed8595577 SPIKE: server-side DuckDB virtual server behind ?engine=duck
Working measurement spike for Option C: aggregation runs in a server-side
DuckDB instead of shipping every row to the browser. Opt-in via
?engine=duck; the default client-side WASM path is untouched.

- routes/perspective.js: POST /perspective/init materializes a version's
  forecast table into a persistent in-process DuckDB (ATTACH postgres,
  so 535k rows land in ~1.5s without streaming through Node); POST
  /perspective/sql executes one Perspective-generated statement, with
  Arrow IPC output for viewport reads.
- ui/src/duckServerHandler.js: VirtualServerHandler that delegates SQL
  generation to Perspective's own GenericSQLVirtualServerModel and POSTs
  the result to the server. Adapted from @perspective-dev/client's
  virtual_servers/duckdb.ts — same SQL model, different transport.
- Forecast.jsx: DUCK_MODE branch replaces the heavy /data fetch with
  /perspective/init, opens the hosted table over a message port, and
  shows a latency overlay. applyDepth routes through viewer.restore()
  since the SQL server cannot handle view.set_depth().

Preserved for a future faster-load effort. Findings and the reason this
is not the shipped path (no interactive tree expand/collapse) are in
pf_perspective_options.md on master.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 21:48:06 -04:00
lib Make units column optional throughout source registration and SQL generation 2026-06-12 23:44:06 -04:00
public Add UX mockup and update spec with navigation direction 2026-04-25 14:56:29 -04:00
routes SPIKE: server-side DuckDB virtual server behind ?engine=duck 2026-08-17 21:48:06 -04:00
setup_sql SQL generator: derive date-adjacent columns from pf.dim_period at baseline load 2026-05-23 10:06:05 -04:00
ui SPIKE: server-side DuckDB virtual server behind ?engine=duck 2026-08-17 21:48:06 -04:00
.env.example Initial commit — pivot forecast application 2026-04-01 07:59:05 -04:00
.gitignore Scaffold React/Vite/Tailwind UI with 3-step Setup → Baseline → Forecast flow 2026-04-25 16:28:45 -04:00
CLAUDE.md Record DuckDB virtual-server spike findings; choose display-grain pre-aggregation 2026-08-17 21:47:55 -04:00
install.sh Initial commit — pivot forecast application 2026-04-01 07:59:05 -04:00
package-lock.json SPIKE: server-side DuckDB virtual server behind ?engine=duck 2026-08-17 21:48:06 -04:00
package.json SPIKE: server-side DuckDB virtual server behind ?engine=duck 2026-08-17 21:48:06 -04:00
PERSPECTIVE.md Add PERSPECTIVE.md config/deploy reference; fix CLAUDE.md distribution link 2026-06-15 23:49:53 -04:00
pf_perspective_options.md Record DuckDB virtual-server spike findings; choose display-grain pre-aggregation 2026-08-17 21:47:55 -04:00
pf_spec.md Record DuckDB virtual-server spike findings; choose display-grain pre-aggregation 2026-08-17 21:47:55 -04:00
pf.sh Add pf.sh — interactive deployment and service management script 2026-05-02 20:58:39 -04:00
server.js SPIKE: server-side DuckDB virtual server behind ?engine=duck 2026-08-17 21:48:06 -04:00