Skip to content

feat(results): foreign-key navigation between related rows#239

Open
Maxteabag wants to merge 2 commits into
mainfrom
worktree-feat-fk-navigation
Open

feat(results): foreign-key navigation between related rows#239
Maxteabag wants to merge 2 commits into
mainfrom
worktree-feat-fk-navigation

Conversation

@Maxteabag
Copy link
Copy Markdown
Owner

@Maxteabag Maxteabag commented May 25, 2026

Closes #167.

Press o on a foreign-key cell to jump to the referenced row. Press O on 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

  • 22 unit tests covering FK introspection, quote_literal per type, dialect-aware query construction, and the no-FK base default.
  • 20 integration tests against the existing docker-compose stack — skip cleanly when a service or driver isn't available locally.

Maxteabag added 2 commits May 25, 2026 16:21
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FeatureRequest: Navigate to related tables

1 participant