snow dbt execute commands

The snow dbt execute command executes one of the following dbt commands (https://docs.getdbt.com/reference/dbt-commands) on Snowflake:

For more information about using dbt commands, see the dbt Command reference (https://docs.getdbt.com/reference/dbt-commands).

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 run dbt command using a short name and project variables (relies on the default database and schema set in your config.toml connection profile):

    snow dbt execute my_dbt_project run --vars "{'SCAN_DATE': '1997-01-01', 'environment': 'prod'}"
    
  • Execute the test dbt command and select a specific model subset:

    snow dbt execute my_dbt_project test --select my_model
    

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

Note

To use the --dbt-version option in Snowflake CLI version 3.15.0, you must enable the SNOWFLAKE_CLI_FEATURES_ENABLE_DBT_VERSION feature flag, using either of the following methods:

  • Set the SNOWFLAKE_CLI_FEATURES_ENABLE_DBT_VERSION environment variable to true before running the command.
  • Set the enable_dbt_version configuration option to true in the config.toml file, as shown in the following example:
    [features]
    enable_dbt_version = true