Auto discovery of keys (foreign, primary)

Logging this idea on behalf of @AlanB (feel free to add further commentary)
What problem are you facing?
We are starting a migration project from a largely undocumented system and need to identify how the various tables relate to one another (e.g. what are the foreign / primary keys, potential joins as well as conducting bulk data profiling to understand the structural integrity of the data).
We understand Data Studio can help us iteratively evaluate joins within a workflow and can conduct data profiling at full volume, however it'd be great if the software could go further to intelligently identify potential joins between tables.
What impact does this problem have on you/your business?
The manual effort of identifying and verifying these relationships can take a long time.
Do you have any existing workarounds? If so, please describe those.
It’s something we can do manually with a bit of effort but having the feature would be very helpful.
Do you have any suggestions to solve the problem? Feel free to add images if this helps.
I have seen tools before that offer this capability which I believe work by accessing stored views and query history in the database to profile how tables are commonly joined to make recommendations on key columns.
Some of the big catalog tools have this feature too, so I’m sure it would be useful.
This is then often combined with profiling data e.g. high cardinality for key columns vs low cardinality for reference data.