Skip to content

Join attributes should live on edges, not nodes #8

Closed

Description

@melonamin

Problem

Join metadata (join_type, join_condition) is currently stored on both Node and Edge types. The frontend reads join info from the source node and copies it onto edges for rendering (graphBuilders.ts).

Joins are semantically an edge concept (a relationship between two tables), not a node property. The current approach:

  • Creates redundancy (same info in 3 places: node, JoinDependency edge, DataFlow/Derivation edge)
  • Can cause inconsistency if node and edge data diverge
  • Causes visualization issues when the same table participates in multiple joins

Current Flow

  1. During AST traversal, ctx.current_join_info is set before the joined table node is created
  2. Node is created with join_type/join_condition from context (query.rs:232-248)
  3. Frontend reads from node and propagates to edges (graphBuilders.ts:523-540)

Proposed Fix

  • Remove join_type and join_condition from Node
  • Keep them only on Edge
  • Update the analyzer to attach join info directly to edges at creation time
  • Update the frontend to read join info from edges

Files Involved

  • crates/flowscope-core/src/types/response.rs — Node/Edge definitions
  • crates/flowscope-core/src/analyzer/query.rs — Node creation
  • crates/flowscope-core/src/analyzer/visitor.rs — Join processing
  • packages/core/src/types.ts — TypeScript types
  • packages/react/src/utils/graphBuilders.ts — Graph building

Activity

  1. added a commit that references this issue on Mar 22, 2026
    b4e7b39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions