DIAGRAM & DISCOVERY

Discovery View: Finding Missing Foreign Keys, Indexes, and Orphan Tables

Discovery is the second tab in the mode switcher — a non-spatial alternative to the diagram built for scanning every column across every table without the diagram’s 4-row cap or the need to hunt across the canvas. Every table renders as a collapsible group listing every column in full, with PK/FK badges, type, NOT NULL, FK target, and a per-column gap severity badge where one applies.

Searching

The search bar matches whitespace-separated tokens against table names, column names, and types — all tokens must match, and matched substrings are highlighted inline. A live “N/M columns” counter shows how much the current filter narrowed the view.

The Inspector

Hover or click a column to open the Inspector panel on the right. It shows the column’s existing relationships (both real FKs and inferred ones) and any flagged gaps, plus a “Possible related columns” section — the reason this mode exists.

Possible related columns

This section runs a naming-only heuristic that’s deliberately separate from the diagram’s convention-based FK inference (which only catches patterns like foo_idfoos). It’s built to catch the sloppy or inconsistent naming that convention-matching misses, and flags three kinds of matches:

  • Same name elsewhere — an identical column name in another table with no existing relationship
  • Possible misspelling — a likely misspelling, detected via edit distance (Levenshtein ≤ 2) on names of 5 or more characters; this is the main use case, since it catches naming drift that breaks convention-matching entirely
  • Partial name overlap — a weaker substring match between two column names

A stoplist of generic names (id, name, status, created_at, and similar) suppresses noisy same-name matches on columns that are common across almost every table by convention.

Every row shows a small colored dot (red, blue, or muted, depending on match category) precomputed once per schema, so a possible match is visible without hovering anything. Clicking a related column in the Inspector pins it, scrolls it into view, and briefly pulses its row so you don’t lose track of where you jumped to.

ERD Factory

Schema visualization & analysis for people who ship databases.

© 2026 ERD Factory