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

Add an option to exclude tables #56

Closed
matibarriento opened this issue Nov 22, 2023 · 4 comments
Closed

Add an option to exclude tables #56

matibarriento opened this issue Nov 22, 2023 · 4 comments

Comments

@matibarriento
Copy link

Often databases have more tables that you want to include that those that you want to exclude. Having an exclude option could reduce configuration.

Proposal:
Add --excludedTables with this behavior

--excludedTables strings tables to exclude. Tables listed in --selectedTables have precedence over exclusion.

@vickkhera
Copy link

This would be handy for me to exclude the partition tables. For the purposes of the schema, it is useful to have just the base table without all partitions. Being able to specify an exclusion flag using SQL wildcards and/or regex would help.

One of my schemas has active/historical separation implemented by partitions in Postgres, so I would like to exclude them like this: --excludedTables = "'%_historical', '%_active'" or some variant thereof.

Right now I use this hack:

db_tables=`echo "\dt" | psql -q --csv postgresql://postgres@localhost:54322/postgres | csvq -f csv --without-header "select Name where (Name not like '%_active' and Name not like '%_historical') order by Name"`
mermerd -c postgresql://postgres@localhost:54322/postgres  -o __design__/db_schema_diagram.mmd --schema public --selectedTables `echo $db_tables | tr ' ' ',' `

@KarnerTh
Copy link
Owner

Totally agree - I will have a look at this when I got the time 👍🏼

@ghandic
Copy link

ghandic commented Mar 4, 2024

This would be super useful, let me know if you need a hand with it!

@KarnerTh
Copy link
Owner

Feature is available in version 0.11.0

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