Skip to content

Commit

Permalink
Merge pull request #27 from tedivm/regex_docs
Browse files Browse the repository at this point in the history
Document regex include/exclude options
  • Loading branch information
tedivm authored Nov 21, 2024
2 parents d9df811 + 74ce5bd commit f473a57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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

0 comments on commit f473a57

Please sign in to comment.