feat(schema): transitive cross-DB lineage + node detail pane (#47, PR2)#49
Closed
BorisTyshkevich wants to merge 1 commit into
Closed
feat(schema): transitive cross-DB lineage + node detail pane (#47, PR2)#49BorisTyshkevich wants to merge 1 commit into
BorisTyshkevich wants to merge 1 commit into
Conversation
Second half of issue #47, stacked on PR1 (#48). The fullscreen schema graph now walks lineage transitively across database boundaries and a clicked node opens a detail pane — reaching parity with the system-audit generator. - src/core/schema-graph.js: node() takes explicit db/name (threaded via zip/ rowId) so a dotted *database* name stays intact, not just a dotted table. New pure expandLineage(graph, seedDb, {cap}) — undirected BFS in both directions across DB boundaries, 600-node soft cap -> truncated, tags external = db !== seedDb. New externalDbs(graph, loaded). - src/net/ch-client.js: loadLineageTransitive() loads each frontier of referenced databases concurrently, merging rows, until none new or a db/node cap is hit (-> truncated). loadTableDetail() pulls full columns (key flags + compression sizes), per-partition part/row/byte sums, and DDL — all best-effort via tryQueryData, three reads in parallel. - src/ui/schema-detail.js (new): openDetailPane() — a resizable strip docked in the overlay with the columns / keys / partitions / DDL and an "Insert SHOW CREATE" action; drag-resize clamped, measured once per drag; reuses columnRoles. - src/ui/explain-graph.js: external nodes render dimmed/dashed (.eg-node--ext, carried through dagreLayout); fullscreen node-click opens the detail pane (openNodeDetail) instead of inserting DDL; truncation banner in the overlay bar. - src/core/dot-layout.js: pass `external` through the layout (with kind/db/name). - src/ui/app.js: expandSchemaGraph rewired to loadLineageTransitive -> expandLineage -> loadSchemaCards(reachedDbs), surfacing truncated; new openNodeDetail(node). - src/styles.css: .eg-node--ext, .graph-overlay-note, .schema-detail* classes. Reviewed at high effort (8 angles); no correctness bugs survived. Applied the efficiency/altitude findings: concurrent frontier loads, external through the layout (dropping a side-channel), measure-once resize. Tests: new schema-detail.test.js + extended schema-graph / ch-client / dot-layout / explain-graph / app specs. 930 tests pass; per-file coverage gate green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmDqY6Bxf5b1fyQE8XwA2u
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
PR2 of #47 — the second half of the schema-graph parity work, stacked on #48 (PR1). The fullscreen graph now walks lineage transitively across database boundaries and a clicked node opens a detail pane. Reimplemented on the existing dagre + inline-SVG renderer (no Cytoscape), per CLAUDE.md.
Changes
src/core/schema-graph.jsnode()now takes explicitdb/name(threaded viazip/rowId) so a dotted database name survives, not just a dotted table. New pureexpandLineage(graph, seedDb, {cap})— undirected BFS both directions across DB boundaries, 600-node soft cap →truncated, tagsexternal = db !== seedDb. NewexternalDbs.src/net/ch-client.jsloadLineageTransitive— loads each frontier of referenced DBs concurrently, merges rows, stops atdbCap/nodeCap(→truncated).loadTableDetail— full columns (key flags + compression sizes), per-partition sums, DDL; best-effort viatryQueryData, three reads in parallel.src/ui/schema-detail.js(new)openDetailPane— resizable strip in the overlay: columns / keys / partitions / DDL + "Insert SHOW CREATE"; drag-resize clamped (measured once per drag); reusescolumnRoles.src/ui/explain-graph.js.eg-node--ext); fullscreen node-click opens the detail pane (openNodeDetail); truncation banner in the bar.src/core/dot-layout.jsexternalthrough the layout (alongside kind/db/name).src/ui/app.jsexpandSchemaGraph→loadLineageTransitive→expandLineage→loadSchemaCards(reachedDbs), surfacingtruncated; newopenNodeDetail(node).src/styles.css.eg-node--ext,.graph-overlay-note,.schema-detail*.Tests
New
schema-detail.test.js+ extendedschema-graph/ch-client/dot-layout/explain-graph/appspecs (expandLineage BFS/cap/both-directions/dotted-DB, transitive concurrent loader, detail pane resize/close/insert/sections, external styling through layout, truncation banner). 930 tests pass; per-file coverage gate green.Review
High-effort multi-angle review (correctness / removed-behavior / cross-file / reuse / efficiency / altitude / conventions). No correctness bugs survived — the MV implicit-
.innernode is provably created with valid parts (theundefined-arg path only hits an already-existing node). Applied the efficiency/altitude findings: concurrent frontier loads (was one-DB-at-a-time),externalthrough the layout (dropped a side-channel), measure-once resize.Deploy
Deployed to github.demo (
user_files/github-play-sql.html, no restart). Drag a DB → Expand: rich cards, external-DB objects dimmed/dashed, truncation banner on large graphs, click a node → detail pane (columns/keys/partitions/DDL + Insert SHOW CREATE).Closes #47 (together with #48).
🤖 Generated with Claude Code
https://claude.ai/code/session_01XmDqY6Bxf5b1fyQE8XwA2u