What naming strategy would we like to encourage Mathesar users to employ when naming their foreign key columns?
Obviously users can name their columns as they see fit, but there are sometimes contexts in which the product might suggest a column name, for example in the Link Table dialog or the Move Columns dialog.
When “Publications” is referencing “Authors”, how do we want to recommend that users name that FK column? Our Library Schema uses “Author Id”, which I’d argue serves as a form of recommendation by virtue of being exemplified in the demo video.
Many UI elements throughout Mathesar will juxtapose a FK column name with a value from that column. For example, the column in the Table Page, the filter condition for that column, the field within the Record Page, the search input within the Record Selector. And, given our Record Summary design, all of those places will format the value as a string representation of the record – not the PK value of the record.
Specifically for the demo video, I have been concerned that our current naming strategy will appear awkward. Consider:
Author Id
:Margaret Atwood
In contrast, the following simplified naming strategy produces a UI which feels more natural, given our Record Summary design.
Author
:Margaret Atwood
I’d like to propose the following FK column naming strategy:
If singularization is feasible (e.g. in the demo video and other examples/documentation where we have manual control), we use the singularized form of the linked table name (e.g. “Author”).
In the application, where singularization is not straightforward, we don’t suggest column names. Instead we require the user to manually name the FK column.
Adopting this proposal would mean:
Authors_id
.)
In the application, where singularization is not straightforward, we don’t suggest column names. Instead we require the user to manually name the FK column.