Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude table option (-I ) not functionning #1281

Open
ai2ext opened this issue Sep 1, 2023 · 12 comments
Open

Exclude table option (-I ) not functionning #1281

ai2ext opened this issue Sep 1, 2023 · 12 comments

Comments

@ai2ext
Copy link

ai2ext commented Sep 1, 2023

I'm trying to exclude some tables using the -I option but they remain visible. I even tried to exclude 1 table (so no regular expression) but it doesn't work

Expected Behavior

Tables listed after -I option will not appar in index.html

Current Behavior

Tables listed after -I option continue to appar in index.html

Your Environment

schemaspy-6.2.2

@npetzall
Copy link
Member

npetzall commented Sep 1, 2023

Hi, is it in the HTML or in the graph or both?

@ai2ext
Copy link
Author

ai2ext commented Sep 1, 2023

Hi, thanks for you prompt answer.
In both. In fact it seems to me that -I does nothing

@npetzall
Copy link
Member

npetzall commented Sep 1, 2023

I'll have a look at it.

@npetzall
Copy link
Member

npetzall commented Sep 1, 2023

It might be working but it's synthetically added due to relationships.

This can be verified by checking if the table has relationships. But more clearly the table information that is included in the report only contains the relationship key if the table has been excluded. If the exclusion isn't working all columns of the table would be included.

I have to admit, I haven't tested this on the same version as you. So there might be an issue in 6.2.2. But I can't recall us fixing such an issue. But I'll download and double check when I get some more time.

@ai2ext
Copy link
Author

ai2ext commented Sep 1, 2023

Hi,
There are no relationships in the Oracle database i am using (If you mean foreign keys). I could upgrade to the version you did check. What was it?
Thanks

@npetzall
Copy link
Member

npetzall commented Sep 1, 2023

I tested with SQLite, since it requires minimal setup, I'll double check with Oracle.

I was using a development version that contains some breaking changes. You can find it as downloading the snapshot from the readme.

@ai2ext
Copy link
Author

ai2ext commented Sep 1, 2023

here is my command line:

@ai2ext
Copy link
Author

ai2ext commented Sep 1, 2023

java -jar schemaspy-6.2.2.jar -cp ".\ojdbc8.jar" -I "TableToExclude" -nopages -noimplied -meta ".\relations.xml"

@npetzall
Copy link
Member

npetzall commented Sep 1, 2023

What you can do is run with --debug and pipe it to a file with > then search in the file for the tablename and find if it has been excluded or not.

Because when I ran it it said that it was excluded but then later that it was added as a LogicalTable or if it was remote since there were fk/pk relationship.

Ohh, I need to check, we might have case-sensitive matching on.

@toraritte
Copy link

Leaving a note here for others committing the same mistake of using globbing instead of actual regexes:

Terminal command options (rsync's --exclude & --include, nix-shell's -I, etc.) conditioned me to always use the shell glob patterns, so when schemaspy ... -I "auth_*" (to exclude all tables with the auth_ prefix) didn't work, I arrived at this GitHub issue. The fix was simply to make it a proper regex of -I "auth_.*". (I used SchemaSpy version 6.1.1)

@MetalCamel
Copy link

MetalCamel commented Sep 26, 2023

@toraritte
Thanks for your comment. I was trying to exclude all the TMP_* tables.
It worked when I used the proper regex syntax with the -I option.
-I "TMP_.*"

@ai2ext
Copy link
Author

ai2ext commented Oct 5, 2023

Hi,
thank you all. Indeed, regex syntax was my problem! using -I "XXX." instead of -I "XXX" fix the problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants