dbt™️ commands
dbt-clean
dbt-cleanRun the dbt clean command. Deletes all folders specified in the clean-targets.
Example
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-cleandbt-compile
dbt-compileRun the dbt compile command. Generates executable SQL from source model, test, and analysis files.
Arguments
--global-flags: Global dbt flags applicable to all subcommands. Instead of dash - please use +.
--cmd-flags: Command-specific dbt flags. Instead of dash - please use +.
--model-prefix: Prefix dbt selector, for selecting parents.
--model-postfix: Postfix dbt selector, for selecting children.
--models: dbt-checkpoint is by default running changed files. If you need to override that, e.g. in case of Slim CI (state:modified), you can use this option.
Example
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-compile
args: ["--model-prefix", "+", "--"]or
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-compile
args: ["--models", "state:modified", "--cmd-flags", "++defer", "++state", "path/to/artifacts", "--"]⚠️ do not forget to include -- as the last argument. Otherwise pre-commit would not be able to separate a list of files with args.
dbt-deps
dbt-depsRun dbt deps command. Pulls the most recent version of the dependencies listed in your packages.yml.
Example
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-depsdbt-docs-generate
dbt-docs-generateRun dbt docs generate command. The command is responsible for generating your project's documentation website.
Example
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-docs-generatedbt-parse
dbt-parseRun the dbt parse command. When running dbt >= 1.5, generates manifest.json from source model, test, and analysis files.
Arguments
--global-flags: Global dbt flags applicable to all subcommands. Instead of dash - please use +.
--cmd-flags: Command-specific dbt flags. Instead of dash - please use +.
Example
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-parseor
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-parse
args: ["--cmd-flags", "++profiles-dir", ".", "++project-dir", ".", "--"]⚠️ do not forget to include -- as the last argument. Otherwise pre-commit would not be able to separate a list of files with args.
dbt-run
dbt-runRun dbt run command. Executes compiled SQL model files.
Arguments
--global-flags: Global dbt flags applicable to all subcommands. Instead of dash - please use +.
--cmd-flags: Command-specific dbt flags. Instead of dash - please use +.
--model-prefix: Prefix dbt selector, for selecting parents.
--model-postfix: Postfix dbt selector, for selecting children.
--models: dbt-checkpoint is by default running changed files. If you need to override that, e.g. in case of Slim CI (state:modified), you can use this option.
Example
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-run
args: ["--model-prefix", "+", "--"]or
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-run
args: ["--models", "state:modified", "--cmd-flags", "++defer", "++state", "path/to/artifacts", "--"]⚠️ do not forget to include -- as the last argument. Otherwise pre-commit would not be able to separate a list of files with args.
dbt-test
dbt-testRun dbt test command. Runs tests on data in deployed models.
Arguments
--global-flags: Global dbt flags applicable to all subcommands. Instead of dash - please use +.
--cmd-flags: Command-specific dbt flags. Instead of dash - please use +.
--model-prefix: Prefix dbt selector, for selecting parents.
--model-postfix: Postfix dbt selector, for selecting children. --models: dbt-checkpoint is by default running changed files. If you need to override that, e.g. in case of Slim CI (state:modified), you can use this option.
Example
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-test
args: ["--model-prefix", "+", "--"]or
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: dbt-test
args: ["--models", "state:modified", "--cmd-flags", "++defer", "++state", "path/to/artifacts", "--"]⚠️ do not forget to include -- as the last argument. Otherwise pre-commit would not be able to separate a list of files with args.
Last updated
Was this helpful?