Skip to content

Show only matching tables with --only-matching #741

Closed
@sualeh

Description

@sualeh

Hi,
I am trying to generate ER Diagram for a large Oracle Database for a schema comprising around 1k tables and using schemacrawler v16.16.15 along with Graphviz v2.40
We are not looking for an ERD for entire schema as it will be obviously not that readable, but for a given table.
Input is a single table name and the output should show diagrammatic representation for a particular table i.e. only significant columns, such as primary and foreign key columns for this table and directly related tables (having constraint columns).

I am using -grep-tables along with -info-level=standard --command=brief command-line options to achieve the same.

Command used:
schemacrawler.sh --command=brief --output-format=png --output-file=graph1.png --info-level=standard --server=oracle --host= --port= --database= --schemas=TESTUSER --user=TESTUSER --password= --no-info --loglevel=ALL --table-types=TABLE --no-remarks=true --only-matching --grep-tables=.*.TABLE1

But this command only displays the table given under grep-tables in a tabular diagram while only the name of the corresponding FK column from the parent tables (containing columns that form the foreign key) is shown. Sample output given below:
graph1

Requirement is to show significant columns from all the tables shown in the diagram (keeping referential integrity depth w.r.t. the input table as 1).

I also tried using the "parents" command line option. But the moment I use --parents=1, I start seeing the FK constraints of the parent table for other tables as well in my diagram which defeats my purpose.

Command used:
schemacrawler.sh --command=brief --output-format=png --output-file=graph2.png --info-level=standard --server=oracle --host= --port= --database= --schemas=TESTUSER --user=TESTUSER --password= --no-info --loglevel=ALL --table-types=TABLE --no-remarks=true --only-matching --grep-tables=.*.TABLE1 --parents=1

Output:
graph2

Expected output:
Expected_Output
Hence we are looking for a way to hide non relevant constraints for the other tables (apart from TABLE1 in example above) but important columns from all tables (both TABLE1 and TABLE2) should be visible.
Any help on the same is appreciated.

Originally posted by @Git4geeks in #739

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions