Smart foreign-key display values

◐ in progress

Help foreign keys show the human-friendly value behind the id, not just another opaque number.

Foreign keys are useful to the database but not always kind to human eyes. An OwnerId of 48213 tells you nothing; “Acme Corp” tells you everything. SQLly works out the likely human-friendly display value for each relationship so the id can show its meaning.

How the display column is guessed

From the schema itself, not from a hard-coded list of column names. SQLly follows the declared foreign key to the referenced table and looks for the column most likely to be what a person would recognise - a short, unique, human-readable text column in preference to a code, a timestamp, or another key. Where no formal key is declared, name-inferred relationships fill in.

Adjustable when needed. A guess is a guess: override the display column for any relationship where SQLly does not pick the right one, and the choice sticks.

Where it shows up today

  • The row editor - already live. A foreign-key field offers searchable referenced values, so you pick “Acme Corp” and SQLly stores the id.
  • Completion - already live where you have configured it, via FK / name interchangeability: type the name in a WHERE clause and get the id.
  • The result grid - the remaining work. Bringing the name alongside the id in a grid cell means fetching the referenced values for the rows on screen, on a background task, without turning one query into hundreds.

In progress. The relationship model and the display-value resolution exist and are used by the row editor; the grid rendering path is what is still being built.