Add option to link tables by indexed columns
Brought to you by:
johncurrier
Similar to the earlier request for ruby-on-rails
implied relations - add an option that causes
schemaspy to map relationships for 'utility' tables
when a column name in one table matches to any other
tables with indexed columns with the same name. So
only link if the column names, type, and size are the
same and the column being linked to has an index.
Might be nice to be able to supply a regex with the
option that tells it which tables to do this for -
with the default being all tables.
Example - adding the -link option would trigger this
for all tables, using -link "(invoice.*)|(order.*)"
would only link the tables that start with invoice or
order.
Logged In: YES
user_id=1264584
Originator: NO
If I'm reading this correctly then the only change in current behavior is from "primary keys" to "indexed columns", right? I'm not sure what implications this will have though as I believe that I start with primary keys when trying to determine child table relationships. I'll look into it.
John
I was thinking that using the proposed new option -link would be an addition to what schemaspy already does. So do the existing primary key link always, but if the -link option is used, then also show indexed column linkages. The original request mentioned 'utility tables', but the new feature should be done for all tables.