summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Sempere <msempere@users.noreply.github.com>2023-04-21 08:15:31 +0100
committerGitHub <noreply@github.com>2023-04-21 09:15:31 +0200
commit5d3e86e2a48adf7a308773f8f1b725d187c7c5ef (patch)
tree8c1215bbe89bf4755b1c875c7655bf8c221cef91
parent07454029bd67239ce42aaa68b427fbbe8e428e7d (diff)
downloadzsh-5d3e86e2a48adf7a308773f8f1b725d187c7c5ef.tar.gz
zsh-5d3e86e2a48adf7a308773f8f1b725d187c7c5ef.tar.bz2
zsh-5d3e86e2a48adf7a308773f8f1b725d187c7c5ef.zip
feat(dbt): create plugin (#11635)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
-rw-r--r--.github/CODEOWNERS1
-rw-r--r--plugins/dbt/README.md29
-rw-r--r--plugins/dbt/dbt.plugin.zsh23
3 files changed, 53 insertions, 0 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 599b765ca..0c5f3acee 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -10,3 +10,4 @@ plugins/universalarchive/ @Konfekt
plugins/wp-cli/ @joshmedeski
plugins/zoxide/ @ajeetdsouza
plugins/starship/ @axieax
+plugins/dbt/ @msempere
diff --git a/plugins/dbt/README.md b/plugins/dbt/README.md
new file mode 100644
index 000000000..e05d79cc3
--- /dev/null
+++ b/plugins/dbt/README.md
@@ -0,0 +1,29 @@
+# dbt plugin
+
+## Introduction
+
+The `dbt plugin` adds several aliases for useful [dbt](https://docs.getdbt.com/) commands and
+[aliases](#aliases).
+
+To use it, add `dbt` to the plugins array of your zshrc file:
+
+```
+plugins=(... dbt)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+| ------ | ------------------------------------------------ | ---------------------------------------------------- |
+| dbtlm | `dbt ls -s state:modified` | List modified models only |
+| dbtrm | `dbt run -s state:modified` | Run modified models only |
+| dbttm | `dbt test -m state:modified` | Test modified models only |
+| dbtrtm | `dbtrm && dbttm` | Run and test modified models only |
+| dbtrs | `dbt clean; dbt deps; dbt seed` | Re-seed data |
+| dbtfrt | `dbtrs; dbt run --full-refresh; dbt test` | Perform a full fresh run with tests |
+| dbtcds | `dbt docs generate; dbt docs serve` | Generate docs without compiling |
+| dbtds | `dbt docs generate --no-compile; dbt docs serve` | Generate and serve docs skipping doc. re-compilation |
+
+## Maintainer
+
+### [msempere](https://github.com/msempere)
diff --git a/plugins/dbt/dbt.plugin.zsh b/plugins/dbt/dbt.plugin.zsh
new file mode 100644
index 000000000..6fcc2eecf
--- /dev/null
+++ b/plugins/dbt/dbt.plugin.zsh
@@ -0,0 +1,23 @@
+# list modified models only
+alias dbtlm="dbt ls -s state:modified"
+
+# run modified models only
+alias dbtrm="dbt run -s state:modified"
+
+# test modified models only
+alias dbttm="dbt test -m state:modified"
+
+# run and test modified models only
+alias dbtrtm="dbtrm && dbttm"
+
+# re-seed data
+alias dbtrs="dbt clean; dbt deps; dbt seed"
+
+# perform a full fresh run with tests
+alias dbtfrt="dbtrs; dbt run --full-refresh; dbt test"
+
+# generate and serve docs
+alias dbtcds="dbt docs generate; dbt docs serve"
+
+# generate and serve docs skipping doc. re-compilation
+alias dbtds="dbt docs generate --no-compile; dbt docs serve"