You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: readme.md
+13-5
Original file line number
Diff line number
Diff line change
@@ -33,36 +33,45 @@ It is recommended to use the -l "tala" option, which renders ERD diagrams the be
33
33
34
34
## Features
35
35
36
+
36
37
### Basic ERD Diagram
37
38
38
39
If you use the application with its defaults, and point at a MySQL database, you will get a basic ERD diagram of the database. This will include all tables, and all foreign keys which are recorded in the database information schema.
39
40
41
+
40
42
### Grouped Tables
41
43
44
+
42
45
As part of diagramming a large database, you may want to introduce some manual groupings of tables. This is supported by the application, and can be done by adding the groups into a .json file and pointing the application at it's path using the variable `TABLE_GROUPS_PATH`. An example of this can be found in `example_table_groups.json` in the `cmd/` directory. Both relative and absolute paths are supported.
43
46
44
47
This can be of special use when refactoring a database, as you can group tables together which are related, and the diagram will then illustrate the way that your logical groups remain interconnected.
45
48
46
49
You will need to enable the grouped tables behaviour by setting `TABLE_GROUPS` to 'true' in your environment variables.
47
50
51
+
48
52
### Virtual Links
49
53
54
+
50
55
Sometimes you may want to show a relationship between two tables which is not recorded in the database schema. This is supported by the application, and can be done by adding the virtual links into a .json file and pointing the application at it's path using the variable `VIRTUAL_LINKS_PATH`. An example of this can be found in `example_virtual_links.json` in the `cmd/` directory. Both relative and absolute paths are supported.
51
56
52
57
This feature can be of use when you have either a not very well formed database, where the logical links aren't captured in the structure (for one reason or another, many legitimate). It can also be of use when you have a database which is in the process of being refactored to support some microservices, and you still have multiple services writing to the same database.
53
58
54
59
You will need to enable the virtual links behaviour by setting `VIRTUAL_LINKS` to 'true' in your environment variables.
55
60
61
+
56
62
### Minimalist Restrictions
57
63
64
+
58
65
When diagramming a large database, you may find yourself hitting the limitations of your chosen layout engine. This is especially common when you are working with a database where the tables have lots of columns. This is reasonably common if you have a database with a low level of normalisation, intentional or otherwise.
59
66
60
67
You can simplify this by restricting the application to only display the columns which are used in the foreign keys of the tables. This will reduce the number of columns displayed, and will allow you to cleanly render diagrams of larger databases.
61
68
62
69
You can enable this by setting the environment variable `RESTRICTOR_TYPE` to 'minimal'.
63
70
71
+
64
72
### User Permission Restrictions
65
73
74
+
66
75
For purposes of access management, it can be of use to create a view of the tables and columns which are accessible to a particular user. This can be done by setting the environment variable `RESTRICTOR_TYPE` to 'user'.
67
76
68
77
You will need to also set the environment variable `DESIGNATED_USER` to the name of the user you want to restrict the diagram to. Currently this needs to be the full name of the user, including the host.
@@ -82,11 +91,10 @@ In the root directory:
82
91
83
92
## Roadmap
84
93
85
-
- Find a way to run `d2 fmt` on the output of the program, for better formatting
86
-
- Extend docs to include walkthrough for using `incredible-cli` for env var management
87
-
- Optionally supply configuration options via commandline
88
-
- Optionally supply configuration options via .yaml config
0 commit comments