Entity relationship diagram

Open
#340 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
mysql, postgresql, rust
Domain
cli, databases

Research direction

Start with a design pass covering PostgreSQL and MySQL catalog metadata, and decide how diagrams for schemas with hundreds of tables stay readable. Then map declared foreign keys into a schema graph and define the selected table’s neighbourhood view, keyboard and mouse navigation, table opening, and Mermaid and D2 exports. Done means the design and the listed graph, neighbourhood, export, and documentation work are complete; schema editing is out of scope.

Written by the indexing model from the issue text.

Description

enhancement roadmap
Summary

See how the tables of a schema relate to each other without leaving the terminal: a relationship diagram for a whole schema, and a smaller view of the tables directly connected to the one you are looking at.

Scope

In:

  • A relationship graph per schema, built from catalog metadata only (no table reads)
  • A neighbourhood view: the selected table and the tables linked to it, with the columns that link them
  • Moving through the diagram by keyboard and mouse, and opening a table from it
  • Export of the full diagram as text (Mermaid and D2), since a large schema does not fit on a terminal screen

Out (for now): editing the schema from the diagram.

Design notes
  • Declared foreign keys are the base of the graph.
  • Links inferred from naming and types (<table>_id to <table>.id, with matching column types) may be added, always marked as inferred and open to confirmation, never shown as if declared.
  • The same graph can serve going to a table through a foreign key (#324).
  • A design pass comes first, covering PostgreSQL and MySQL together, including how a schema with hundreds of tables stays readable.
Related
  • Design
  • Relationship graph (PostgreSQL and MySQL)
  • Neighbourhood view
  • Full schema diagram and text export
  • Docs
Dominant language
Rust
Stars
166
Forks
8
Avg merge
4h 24m
Merged PRs (30d)
291

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DokaDev/datarig

All issues in DokaDev/datarig

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.