jakob / jakob/Postico

"Dereference" and show name/label/title for foreign key fields on hover

Open
#260 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
486
Forks
8
PR merge metrics
No merged PRs in 30d

Description

After reading #248 I thought about how the usage of heavily normalised tables could be improved.

Clicking the popup button and then have your eyes search for the correct entry (and column) in the referenced table is a bit cumbersome. Maybe it would be possible to display the corresponding data directly over the cell on hover.

The logic could be as follows:
- have a setting that is an ordered list of column names, that should be used for this display – a default might be `name`, `label`, `title`
- if a column is displayed and it is foreign key to a table that has one of these columns, the first of these (according to the order in the setting) is used in the overlay
- when the cursor hits the first cell of a FK-column make a request like `SELECT "pk_column", "name" FROM "referenced_table" WHERE "pk_column" IN ($distinct_fk_values_displayed_on_current_page);`
- put the data in a dictionary and then display the user identifiable data over the cell data itself, left of the open-fk-popup-button – this way the users eyes will not have to move/search for the wanted information
- there would be max 1 extra request per FK-column per page view – maybe you could restrict it to columns that have indexes to ensure that the queries will fast

What do you think about this?

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named; begin by locating the foreign-key cell rendering and query code. Done would mean showing the configured name, label, or title over foreign-key cells with at most one extra lookup per foreign-key column per page view.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.