I’ve noticed a phenomenon which happened a few times and really is undesirable.
We have a dashboard that I built and maintain which is publicly facing our customers. Most questions are built with the query editor, a few are native SQLs. Some questions are visualized as tables.
The table visualization is set with specific columns and custom names for those columns. I’ve noticed in some cases is that at some points new columns from related tables appear in the output visualization. While those are true/correct, they should absolutely not be visible. The data is not meant for customer facing and the header names are raw created by Metabase and not edited into a friendly human name.
When this happens, new columns always appear at the end (right side of the table). To me it seems that maybe new columns become available in the source table and there are therefore automatically added to the question visualization. As if the default is to add new available columns everywhere. This is very problematic, as it means we can’t prevent new columns from appearing where they should not be visualized.
The columns are getting pulled in through an implicit join on a foreign key.
If you don’t want the implicit join to happen, go into Table Metadata and remove the Foreign Key type from the ID column on the incoming table. You can also use table permissions to disallow access to that table to your external users.
If you need this to not happen and you don’t have control over when the foreign keys are introduced (or other database schema changes), create a database view or Metabase Model of the table and use that as the data source for your questions. That way, they won’t change unless you explicitly change them.
You can also set the database to never sync metadata automatically, so you can dictate when changes happen in Metabase. Or always use SQL questions, which will only return columns you list explicitly (don’t use *).
The other ways are to use multiple database connections with different database users and grants (one for public and one for private data, for instance), which gets messy to manage in Metabase, or upgrade to Pro and use the Metabase Row Level Security features.
Thanks for the suggestions here. This looks interesting.
If not, I may need to go down using Models for the tables but it means I have to rebuild the questions with models as the source can’t be just swapped.
In any case, there are concrete solutions here. Thanks.
A follow up question to understand if this can be a fix to the problem.
In the table options, there is the Add or remove columns setting.
I never understood what is the difference between this setting and just toggling the eye icon to show or hid a column…
Using this , Add or remove columns setting and only adding the ones the specific ones to keep, would it prevent new columns form implicit joins from appearing?