Skip to content

Commit f473a57

Browse files
authored
Merge pull request #27 from tedivm/regex_docs
Document regex include/exclude options
2 parents d9df811 + 74ce5bd commit f473a57

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ from example_app.models import *
7373

7474
### Include or Exclude tables
7575

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

7979
```bash
@@ -91,6 +91,14 @@ paracelsus graph example_app.models.base:Base \
9191
--include-tables "posts"
9292
```
9393

94+
You can also use regular expressions in the `include-tables` and `exclude-tables` options.
95+
96+
```bash
97+
paracelsus graph example_app.models.base:Base \
98+
--import-module "example_app.models.*" \
99+
--exclude-tables "^com.*"
100+
```
101+
94102
### Specify Column Sort Order
95103

96104
By default Paracelsus will sort the columns in all models such as primary keys are first, foreign keys are next and all other

paracelsus/cli.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def graph(
5757
] = [],
5858
exclude_tables: Annotated[
5959
List[str],
60-
typer.Option(help="List of tables that are excluded from the graph"),
60+
typer.Option(help="List of tables or regular expression patterns for tables that are excluded from the graph"),
6161
] = [],
6262
include_tables: Annotated[
6363
List[str],
64-
typer.Option(help="List of tables that are included in the graph"),
64+
typer.Option(help="List of tables or regular expression patterns for tables that are included in the graph"),
6565
] = [],
6666
python_dir: Annotated[
6767
List[Path],

0 commit comments

Comments
 (0)