Automatically replace Foreign Keys

We have a very denormalized user database replica where most queries end up being User_id, objecty_id, objectx_id… etc… so almost every query needs to be written in SQL for me to get readable results. I was wondering if you could add a way to set up what’s the value you should automatically join and replace that field with from the foreign table. It would save me TONS of time.


Does this pull request (which is a work in progress) get at what you’re talking about? It replaces entity IDs with the entity name, but I think you’re talking about taking it a step further and replacing foreign key IDs with their entity names, yeah?

1 Like

Actually, the solution you have in the PR doesn’t look half bad, I’m definitely going for the latter but what you have there would be a clear step in the right direction.

Thanks so much for taking that on, it will definitely make Metabase more useful for us.

Cool. Please feel free to comment on the associated GH issue with your FK use case; we’d love to capture that additional feedback/context.