snow dbt execute commands

The snow dbt execute command executes one of the following dbt commands on Snowflake:

For more information about using dbt commands, see the dbt Command reference.

Examples

The following examples show how to invoke snow dbt execute. The NAME argument identifies the dbt project object you want to run.

  • Execute the build dbt command using a fully qualified object name:

    snow dbt execute uche_db.public.my_dbt_project build
    
  • Execute the test dbt command, select a specific model subset, and override the dbt version for this run:

    snow dbt execute --dbt-version '1.11.11' my_dbt_project test --select my_model+
    
  • Execute the run dbt command with inline environment variable overrides for this run:

    snow dbt execute my_dbt_project run \
      --env-vars '{"DBT_DATABASE": "tasty_bytes_db", "DBT_SCHEMA": "analytics"}'
    
  • Execute the run dbt command, pulling DBT_-prefixed variables (excluding DBT_ENV_SECRET_* variables) from your shell environment:

    snow dbt execute my_dbt_project run --use-shell-env-vars
    

    --env-vars applies inline DBT_-prefixed overrides for a single execution, and --use-shell-env-vars pulls DBT_-prefixed shell variables into the run (excluding DBT_ENV_SECRET_* variables). To select an environment defined in the project’s env.yml file, add the --env flag. These flags require Snowflake CLI 3.21 or later. For more information, see Using SQL environment variables and private Git packages for dbt Projects on Snowflake.

For more examples and workflow guidance, see Managing dbt Projects on Snowflake using Snowflake CLI.