Skip to content

feat(linux): open referenced and referencing rows from a foreign key - #3797

Merged
datlechin merged 9 commits into
mainfrom
feat/3671-linux-open-referenced-row
Oct 22, 2026
Merged

datlechin merged 9 commits into
mainfrom
feat/3671-linux-open-referenced-row

Conversation

@datlechin

@datlechin datlechin commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Cell menu of a table tab: Open Referenced Row (Ctrl+J, listed in the shortcuts dialog) on a foreign key cell, and Show Referencing Rows on a saved row, one item per key pointing at it.
  • The rows open in a new tab beside the source tab, filtered on every column of the key with the filter strip shown. A tab already showing those rows comes to the front. A NULL key offers nothing.
  • A column in several keys gets a submenu of table (columns) items, the key's own columns, with the constraint added when two keys from the same columns clash; Ctrl+J offers the same choices at the cell. A key that cannot be followed says why in a toast. A table missing from its schema, read again from the server first, says so instead of opening.
  • Keys between neighbouring types follow: a decimal key is written without its scale's zeros, a real key as the double it widens to, and a filter compares a date with a timestamp's midnight and back.
  • New Connection::fetch_inbound_foreign_keys on every driver, sharing the SQL fetch_table_definition runs. The browse tab reads its keys with its columns; a failure never fails the tab and is asked again on the next connection.
  • A table tab keeps its own filter in the saved workspace and through Reopen Closed Tab. A followed filter does not replace the table's remembered one until the user applies a filter.
  • Filters compare binary columns to a 0x hex value, and the filter strip lists binary columns.
  • The saved tabs keep at most 256 KiB of filters, so a filter from a large binary key cannot make the workspace file too large to read back.
  • PostgreSQL: the partition clones of a foreign key are no longer listed as keys, outbound or inbound.
  • SQL Server: filters compare text, ntext and image columns cast to their max types, which =, <> and IN need.
  • SQLite: a key's table and columns come back as the parent declares them, not as the REFERENCES clause spelled them. A key to a missing table no longer fails the read of every key of the table. Show Referencing Rows refuses, with a toast, a key whose parent columns compare under another affinity or collation than the child's, where = would miss rows or add some.
  • One shared ui::menu_label replaces the two copies in the picker and the structure tab.
  • Tests changed on purpose: a_filter_on_a_binary_column_reads_the_hex_form_an_export_writes (was ..._compares_text), add_rule_appends_a_row_for_the_first_column and set_columns_rebuilds_the_column_choices now expect a binary column in the strip; a_blob_is_not_filterable is removed with is_filterable.

Test plan

  • Core: RowReference (composite keys, NULL, empty text, blobs, uneven keys, unknown schema, decimal and real keys), hex decode, binary filter parse and bind, date and timestamp comparison.
  • SQLite: declared spellings both ways, a key to a missing table, inbound keys read alone equal the definition's, blob equality.
  • PostgreSQL, MySQL/MariaDB, SQL Server (docker, run here): inbound keys read alone, partition clones dropped, bytea, varbinary, image, text and ntext equality, the DDL conformance cases that read keys back.
  • Grid: menu items per cell, submenu for two keys, referencing rows skip drafts, refusal toast, Ctrl+J with one key and with two.
  • Browse tab: keys read with the columns and again after a reconnect, followed filter kept off the table's store, strip revealed.
  • Workspace: opens beside the source, reveals an open tab, toasts a missing table, saved record and reopen keep the filter, the filter budget.
  • verify.sh build, test, lint and the CI fast job's meson test in the dev container.

Fixes #3671

@datlechin
datlechin merged commit d807095 into main Oct 22, 2026
30 of 31 checks passed
@datlechin
datlechin deleted the feat/3671-linux-open-referenced-row branch October 22, 2026 23:14
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.

Open the referenced row from a foreign key on Linux

1 participant