feat(results): foreign-key navigation between related rows#239
Open
Maxteabag wants to merge 2 commits into
Open
feat(results): foreign-key navigation between related rows#239Maxteabag wants to merge 2 commits into
Maxteabag wants to merge 2 commits into
Conversation
Press `o` on a foreign-key cell to jump to the referenced row, or `O` on a referenced column to pick from incoming references. Hints render in the footer only when the cursor column actually has those relationships. FK introspection added to 14 adapters via a new ForeignKeyInspector protocol: SQLite, PostgreSQL (+CockroachDB, Supabase), MySQL (+MariaDB), MSSQL, DuckDB (+MotherDuck), Oracle (+OracleLegacy), Snowflake, Turso, and Cloudflare D1.
Adds get_foreign_keys / get_referencing_foreign_keys to BigQuery, Db2, Firebird, SAP HANA, Redshift, Spanner, and Teradata using each engine's native catalog (INFORMATION_SCHEMA, pg_catalog, SYSCAT, RDB$*, SYS.*, DBC.All_RI_*). Integration tests against the existing docker-compose stack verify the queries actually work end-to-end on real engines: SQLite, DuckDB, PostgreSQL, MySQL, MariaDB, MSSQL, CockroachDB, Turso, and Firebird. ClickHouse is exercised as the no-FK-support case. Tests skip cleanly when a service or driver isn't available locally. All 21 FK-capable adapters now have introspection support; 9 of them are also verified end-to-end via docker integration tests.
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.
Closes #167.
Press
oon a foreign-key cell to jump to the referenced row. PressOon a referenced column (typically a PK) to pick from a list of tables that reference it. Footer shows the hints only when the cursor column actually has those relationships, so it stays quiet on plain columns.Coverage
Implemented (all 21 FK-capable adapters):
SQLite, PostgreSQL, CockroachDB, Supabase, MySQL, MariaDB, MSSQL, DuckDB, MotherDuck, Oracle, OracleLegacy, Snowflake, Turso, Cloudflare D1, BigQuery, Db2, Firebird, SAP HANA, Redshift, Spanner, Teradata.
Verified end-to-end via docker integration tests (9 engines):
SQLite, DuckDB, PostgreSQL, MySQL, MariaDB, MSSQL, CockroachDB, Turso, Firebird.
Code-only verified (12 engines — no local emulator, or emulator doesn't support FK DDL):
Oracle, Snowflake, Db2, HANA, Redshift, Spanner, Teradata, BigQuery, MotherDuck, OracleLegacy, Supabase, D1.
Correctly no-op (engines with no FK metadata, base default returns
[]):ClickHouse, Athena, Trino, Presto, Impala, Flight, osquery, SurrealDB.
Tests
quote_literalper type, dialect-aware query construction, and the no-FK base default.