#60 Showing only table associations (no columns)

open
John Currier
5
2010-01-05
2010-01-05
Julien Aubert
No

I have a quite complex schema and I would like a high level view.
Would be great to have:

* one page showing each table as a node - only with the table name - no columns etc
* edges between those tables that are related (edges are undirected, and related is determined if they have fk between each other)

Example (disregard whether it is probable or good - just to show the expected output):
* say I have three tables A,B,C.
* say that A has one fk to B and one fk to C
* say that C has a fk to B
Expected output:

(schemaName.A) -------- (schemaName.B)
| /
| /
(schemaName.C)

(Note - no other info in the nodes except the table name - including the schema name if there are tables with same name but in different schemas).

Thankful for any feedback.

Discussion

  • John Currier
    John Currier
    2010-01-06

    Would this be significantly smaller than the compact view that only shows primary keys and indexes?

    Note that you should be able to write a simple script that removes all <TR> entries that aren't the table name from the relationships .dot file. Currently the only differentiation is that the table name comes first and has a (default) color of #9bab96.

    Then recreate the .png with
    dot -Tpng:cairo relationships.real.compact.dot -orelationships.real.compact.png -Tcmapx

    John

     
  • Julien Aubert
    Julien Aubert
    2010-01-07

    As I am using composite keys heavily, and the indexes would clutter a bit, it would be significantly smaller without the primary keys.

    I think that when there are around 50+ tables this feature starts to make sense. Actually I suppose what I am really asking for is being able to given the detailed schema spec, produce an high level ER diagram as automatically as possible, most importantly an ER diagram cross-cutting the schemas, and preferably also an ER diagram per schema. (High level in the sense as in neglecting the attributes of the table and assuming the table name is the entity)

    I looked a bit at the code. If you are interested, I could make an attempt or if you are interested in implementing yourself I could assist. I presume the path would be something along the lines of:
    * creating a "HtmlTableAssociationsPage"
    * creating the dot file using the option of no columns in the DotNode
    * add option to DotConnector not to use the connected details information, so that for the table associations dot files, it won't connect the attributes but instead only connect table2table.

    I only had a quick glimpse through the code so please let me know if this is not right.

    Thanks for the tip on the script, however I would rather solve it as a feature for SchemaSpy - unless it would go against any principles/ideals for the tool?

    Thanks for a great tool and your support.

     
  • John Currier
    John Currier
    2010-01-08

    I'm thinking that this "tables only" diagram would go on the bottom of the tables page, right?

    The cross-cutting diagram would be more difficult to implement since SchemaSpy was built around analyzing a single schema at a time. A diagram like that would be slick and fit in perfectly, but potentially lots of work.

    John

     
  • Julien Aubert
    Julien Aubert
    2010-01-08

    I agree, good idea, that would be an appropriate place for a such diagram.
    The cross-cutting-schema diagram would be nice but a table-only per schema is a good start.

    How would you prefer this would proceed?

     
  • John Currier
    John Currier
    2010-01-08

    I should have some time in the middle of next week to play with this. It'll be an interesting enhancement.

     
  • Julien Aubert
    Julien Aubert
    2010-01-08

    Great. Thanks - and let me know if I can be of any help.

     
  • John Currier
    John Currier
    2010-01-11

    I guess it'd be called "Related Tables" since it would be a mess if it included all tables (especially if there are no relationships). It'll also need "real" vs. "implied" variants.