Assume we have two tables, member and company, both tables have id as primary key. If I set a column company_id in the member table as a foreign key, on the select query the column presents an integer value.
how can I make it possible to get access to the other columns in the company table such as name, phone, and email?
Option 1: Can we somehow get object/array of the referenced record? example: copmany_id_1[name, phone, email]
Option 2: Can we access it through company_id.name or company_id.phone?
Option 3: Can we get the list of foreign key columns and their referenced table and column and fire another query to get the result? this will be much slower if the table contains many foreign keys.