Foreign key / name interchangeability
plannedLook up a familiar name instead of memorizing an id; SQLly follows the relationship for you.
Databases are fond of ids; people are usually fond of names. When you ask for values on a foreign-key id column, SQLly follows the foreign key and lets you search by name and insert the id. Put the cursor after WHERE CategoryID = and run Edit › Table Column Value Autocomplete: instead of the raw ids, the list shows the category names from Categories. Type part of a name to narrow it, and accepting one inserts the id with the name as a comment, such as CategoryID = 1 /* Beverages */. Typing an id still matches too.
How the name column is chosen
There's nothing to configure. SQLly reads the foreign key from the loaded data model and picks the referenced table's readable column, first match wins:
- A column called
Name. - The table's own name column:
CategoryNameonCategories(the singular of a plural table name counts), orCategory_Name. - The first text column whose name ends in
Name, such asCompanyName. - A column called
Label,Display,Description, orCode. - The first text column that isn't part of a key, and failing that the id itself.
Only = comparisons follow the key; after LIKE you get the column's own values. If the name lookup fails (for example, you can't read the referenced table), SQLly falls back to listing the raw ids. The list holds at most 100 rows, ordered by name.

