Skip to content

Commit

Permalink
docs: Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
datnguye committed Sep 2, 2023
1 parent 70b4a93 commit 596ff15
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 30 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pip install dbterd --upgrade
```

Verify installation:

```bash
dbterd --version
```
Expand Down
64 changes: 34 additions & 30 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dbterd

CLI to generate Diagram-as-a-code file ([DBML](https://dbdiagram.io/d), [Mermaid](https://mermaid-js.github.io/mermaid-live-editor/), [PlantUML](https://plantuml.com/ie-diagram), [GraphViz](https://graphviz.org/), [D2](https://d2lang.com/)) from dbt artifact files (required: [![dbt](https://img.shields.io/badge/manifest.json-upto--v9-3776AB.svg?style=flat&logo=dbt&logoColor=orange)](https://schemas.getdbt.com/) [![dbt](https://img.shields.io/badge/catalog.json-upto--v1-3776AB.svg?style=flat&logo=dbt&logoColor=orange)](https://schemas.getdbt.com/))
CLI to generate Diagram-as-a-code file ([DBML](https://dbdiagram.io/d), [Mermaid](https://mermaid-js.github.io/mermaid-live-editor/), [PlantUML](https://plantuml.com/ie-diagram), [GraphViz](https://graphviz.org/), [D2](https://d2lang.com/)) from dbt artifact files (required: [![dbt](https://img.shields.io/badge/manifest.json-upto--v10-3776AB.svg?style=flat&logo=dbt&logoColor=orange)](https://schemas.getdbt.com/) [![dbt](https://img.shields.io/badge/catalog.json-upto--v1-3776AB.svg?style=flat&logo=dbt&logoColor=orange)](https://schemas.getdbt.com/))

[![PyPI version](https://badge.fury.io/py/dbterd.svg)](https://pypi.org/project/dbterd/)
![python-cli](https://img.shields.io/badge/CLI-Python-FFCE3E?labelColor=14354C&logo=python&logoColor=white)
Expand All @@ -15,42 +15,46 @@ CLI to generate Diagram-as-a-code file ([DBML](https://dbdiagram.io/d), [Mermaid
<a href="#" data-terminal-control="">restart ↻</a>
</div>

Verify installed version:
Verify installation:

```bash
dbterd --version
```

## Quick examine with existing samples

```bash
# select all models in dbt_resto
dbterd run -ad samples/dbtresto -o target
# select all models in dbt_resto, Select multiple dbt resources
dbterd run -ad samples/dbtresto -o target -rt model -rt source
# select only models in dbt_resto excluding staging
dbterd run -ad samples/dbtresto -o target -s model.dbt_resto -ns model.dbt_resto.staging
# select only models in schema name mart excluding staging
dbterd run -ad samples/dbtresto -o target -s schema:mart -ns model.dbt_resto.staging
# select only models in schema full name dbt.mart excluding staging
dbterd run -ad samples/dbtresto -o target -s schema:dbt.mart -ns model.dbt_resto.staging

# other samples
dbterd run -ad samples/fivetranlog -o target
dbterd run -ad samples/fivetranlog -o target -rt model -rt source

dbterd run -ad samples/facebookad -o target
dbterd run -ad samples/facebookad -o target -rt model -rt source

dbterd run -ad samples/shopify -o target
dbterd run -ad samples/shopify -o target -rt model -rt source

dbterd run -ad samples/dbt-constraints \
-a "test_relationship:(name:foreign_key|c_from:fk_column_name|c_to:pk_column_name)"

# your own sample without commiting to repo
dbterd run -ad samples/local -o target -rt model -rt source
```
<details>
<summary>Click me</summary>

```bash
# select all models in dbt_resto
dbterd run -ad samples/dbtresto
# select all models in dbt_resto, Select multiple dbt resources
dbterd run -ad samples/dbtresto -rt model -rt source
# select only models in dbt_resto excluding staging
dbterd run -ad samples/dbtresto -s model.dbt_resto -ns model.dbt_resto.staging
# select only models in schema name mart excluding staging
dbterd run -ad samples/dbtresto -s schema:mart -ns model.dbt_resto.staging
# select only models in schema full name dbt.mart excluding staging
dbterd run -ad samples/dbtresto -s schema:dbt.mart -ns model.dbt_resto.staging

# other samples
dbterd run -ad samples/fivetranlog
dbterd run -ad samples/fivetranlog -rt model -rt source

dbterd run -ad samples/facebookad
dbterd run -ad samples/facebookad -rt model -rt source

dbterd run -ad samples/shopify -s wildcard:*shopify.shopify__*
dbterd run -ad samples/shopify -rt model -rt source

dbterd run -ad samples/dbt-constraints -a "test_relationship:(name:foreign_key|c_from:fk_column_name|c_to:pk_column_name)"

# your own sample without commiting to repo
dbterd run -ad samples/local -rt model -rt source
```

</details>

## Quick DEMO

Expand Down

0 comments on commit 596ff15

Please sign in to comment.