Skip to content

Commit

Permalink
docs: update doc site
Browse files Browse the repository at this point in the history
  • Loading branch information
datnguye committed Sep 7, 2023
1 parent 0cc2cbd commit b060bfe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
20 changes: 15 additions & 5 deletions docs/nav/guide/cli-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Rules:
- By `name`: model name starts with input string
- By `schema`: schema name starts with an input string, formed as `schema:<your_schema_name>`
- By `wildcard`: model name matches to a [wildcard pattern](https://docs.python.org/3/library/fnmatch.html), formed as `wildcard:<your_wildcard>`
- By `exposure`: exposure name, exact match

**Examples:**
=== "CLI (by name)"
Expand All @@ -119,6 +120,11 @@ Rules:
```bash
dbterd run --select "wildcard:*xyz"
```
=== "CLI (by exposure)"

```bash
dbterd run --select "exposure:my_exposure_name"
```

#### `AND` and `OR` logic

Expand Down Expand Up @@ -161,11 +167,7 @@ Exclusion criteria. Rules are the same as Selection Criteria.
Target to the diagram-as-code platform
> Default to `dbml`
Supports:

- [`dbml`](https://www.dbml.org/home/)
- [`mermaid`](https://mermaid.js.org/syntax/entityRelationshipDiagram.html)
- [`plantuml`](https://plantuml.com/ie-diagram)
Supported target, please visit [Generate the Targets](https://dbterd.datnguyen.de/latest/nav/guide/targets/generate-dbml.html)

**Examples:**
=== "CLI"
Expand Down Expand Up @@ -196,6 +198,14 @@ In the above:
> NOTE: It always looking at the `column_name` attribute firstly
- `c_to`: Configure the test metadata attribute (2) for the referenced column name(s). If (2)'s value is multiple columns, it will concat them all with `_and` wording. Default to `field`

!!! tip "For example, if you would use `dbt-constraints` package"
The [dbt-constraints](https://hub.getdbt.com/snowflake-labs/dbt_constraints/latest/) package is using different name of test which is close to the contraint names, in this case, you would need to customize the input string here:

```bash
dbterd run \
--algo "test_relationship:(name:foreign_key|c_from:fk_column_name|c_to:pk_column_name)"
```

**Examples:**
=== "CLI"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class TestDbmlTestRelationship:
schema="--schema--",
columns=[Column(name="name1", data_type="name1-type")],
raw_sql="--irrelevant--",
exposures=["dummy1"]
exposures=["dummy1"],
)
],
[],
Expand All @@ -250,16 +250,16 @@ class TestDbmlTestRelationship:
schema="--schema--",
columns=[Column(name="name1", data_type="name1-type")],
raw_sql="--irrelevant--",
exposures=["dummy1"]
exposures=["dummy1"],
),
Table(
name="model.dbt_resto.table23",
database="--database--",
schema="--schema--",
columns=[Column(name="name23", data_type="name23-type")],
raw_sql="--irrelevant--",
exposures=["dummy2", "dummy3"]
)
exposures=["dummy2", "dummy3"],
),
],
[],
["exposure:dummy2"],
Expand Down

0 comments on commit b060bfe

Please sign in to comment.