Add ER diagram with FK introspection across all databases#201
Open
dcpatrick15 wants to merge 2 commits into
Open
Add ER diagram with FK introspection across all databases#201dcpatrick15 wants to merge 2 commits into
dcpatrick15 wants to merge 2 commits into
Conversation
Adds the ability to generate Unicode ER diagrams showing tables, columns (with PK/FK markers), and foreign key relationship lines. Accessible via S key on explorer tree nodes and space+d leader menu for a table picker modal. Includes FK introspection for PostgreSQL and SQLite providers.
Implements FK introspection for MySQL, MariaDB, MSSQL, Oracle, Firebird, DuckDB, Turso, Snowflake, Spanner, HANA, DB2, Teradata, Redshift, and MotherDuck. Each adapter queries the database's native metadata catalog to return ForeignKeyInfo objects used by the ER diagram feature. Includes 42 unit tests with mocked cursors and integration test coverage via BaseDatabaseTests. All 9 test fixtures updated with test_orders FK table.
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.
Summary
get_foreign_keys()) implemented for all 14 remaining database adaptersHow to use
dto open the ER diagram for that tableDto open the table picker, select tables withspace, confirm withenterhjkl, close withqScreenshots
Test plan
pytest tests/unit/test_foreign_keys.py -v(42 tests)pytest tests/ -v -k test_get_foreign_keys(8 databases verified locally with Docker)pytest tests/unit/test_diagram_layout.py -v