Still trying to understand how Retool works. I have two tables: countries and clients. Client table has a country_id that is linked to the countries id table in PostGre.
When I add a Retool table component so that I can manage clients, I want to show in the table the name (not the id) of the country the client is linked to. However, if I change the getData query with a LEFT JOIN to the countries table, I can't update the table anymore with the updateRow query (that is generated automatically by Retool using the create app from database).
I understand this is a very basic question, but can't find the answer anywhere.
What is the best pattern to include linked tables on a Retool table component?
I've tried both INNER JOIN and LEFT JOIN, and that doesn't seem to affect the fact that updateRow query generate "0 updated records" after updating the form (both the updateRow and the form were auto-generated by Retool)
The specific getData query is select * from "companies" left join geographies on companies.geography_id = geographies.id where ({{ !searchBar.value }} or cast("name" as text) ilike {{ '%' + searchBar.value + '%' }});
Try select * from companies c left join geographies g on g.id = c.geography_id where ({{ !searchBar.value }} or cast(name as text) ILIKE {{ '%' + searchBar.value + '%' }});