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

Document regex include/exclude options #27

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ from example_app.models import *

### Include or Exclude tables

After importing the models, it is possible to select a subset of those models by using the `--exlude-tables` and `--include-tables` options.
After importing the models, it is possible to select a subset of those models by using the `--exclude-tables` and `--include-tables` options.
These are mutually exclusive options, the user can only provide inclusions or exclusions:

```bash
Expand All @@ -91,6 +91,14 @@ paracelsus graph example_app.models.base:Base \
--include-tables "posts"
```

You can also use regular expressions in the `include-tables` and `exclude-tables` options.

```bash
paracelsus graph example_app.models.base:Base \
--import-module "example_app.models.*" \
--exclude-tables "^com.*"
```

### Specify Column Sort Order

By default Paracelsus will sort the columns in all models such as primary keys are first, foreign keys are next and all other
Expand Down
4 changes: 2 additions & 2 deletions paracelsus/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def graph(
] = [],
exclude_tables: Annotated[
List[str],
typer.Option(help="List of tables that are excluded from the graph"),
typer.Option(help="List of tables or regular expression patterns for tables that are excluded from the graph"),
] = [],
include_tables: Annotated[
List[str],
typer.Option(help="List of tables that are included in the graph"),
typer.Option(help="List of tables or regular expression patterns for tables that are included in the graph"),
] = [],
python_dir: Annotated[
List[Path],
Expand Down