Repository navigation
ERD: entity relationship diagram #7
Description
Activity
First pass version of the ERD is now implemented as a method on the
Connectionclass. Bulk of the implementation actually lies in a separate moduleerd. Currently you can specify list of tables or list of databases (using class and module names, respectively) and the ERD will only show those specified tables with tables serving as connections between specified tables filled in (e.g. if A is a parent of B, which is a parent of C, creating ERD with A and C which are not directly related will also display table B to make their relationship explicit).I'm still adding more functionality to ERD to allow different degree of control over what tables are plotted.
I realized that automated testing of ERD can be quite difficult as its primary output is a matplotlib figure. I'm guessing we should still write test to make sure the the code runs without hanging. Is there a good way to test for plotting?
There is a decorator that allows you to compare an image to a reference image. However, the problem is that you have to adhere to some matplotlib directory structures which we don't. Therefore, I'd propose to simply test whether the erd produces a figure. Another option would be to test whether the erd produces the correct graph and assume that plotting is correctly is tested somewhere else.
I'm going to go with the latter solution where I check whether the graph structure produced via ERD commands correctly match to what's expected.
Fixed in PR #208
- added a commit that references this issue
on Jan 14, 2020
This was previously implemented using the networkx module. Make this work with the new implementation, probably as a method of Connection.