snow dbt deploy

Upload local dbt project files and create or update a DBT project object on Snowflake. Examples: snow dbt deploy PROJECT snow dbt deploy PROJECT --source=/Users/jdoe/project --force

構文

snow dbt deploy
  <name>
  --source <source>
  --profiles-dir <profiles_dir>
  --force / --no-force
  --default-target <default_target>
  --unset-default-target
  --external-access-integration <external_access_integrations>
  --install-local-deps
  --connection <connection>
  --host <host>
  --port <port>
  --account <account>
  --user <user>
  --password <password>
  --authenticator <authenticator>
  --workload-identity-provider <workload_identity_provider>
  --private-key-file <private_key_file>
  --token <token>
  --token-file-path <token_file_path>
  --database <database>
  --schema <schema>
  --role <role>
  --warehouse <warehouse>
  --temporary-connection
  --mfa-passcode <mfa_passcode>
  --enable-diag
  --diag-log-path <diag_log_path>
  --diag-allowlist-path <diag_allowlist_path>
  --oauth-client-id <oauth_client_id>
  --oauth-client-secret <oauth_client_secret>
  --oauth-authorization-url <oauth_authorization_url>
  --oauth-token-request-url <oauth_token_request_url>
  --oauth-redirect-uri <oauth_redirect_uri>
  --oauth-scope <oauth_scope>
  --oauth-disable-pkce
  --oauth-enable-refresh-tokens
  --oauth-enable-single-use-refresh-tokens
  --client-store-temporary-credential
  --format <format>
  --verbose
  --debug
  --silent
  --enhanced-exit-codes
  --decimal-precision <decimal_precision>
Copy

引数

name

DBT プロジェクトの識別子。例: my_pipeline。

オプション

--source TEXT

デプロイするdbtファイルを含むディレクトリへのパス。デフォルトは現在の作業ディレクトリです。

--profiles-dir TEXT

profiles.ymlを含むディレクトリへのパス。デフォルトは、--sourceまたは現在の作業ディレクトリで提供されるディレクトリです。

--force / --no-force

プロジェクト内に競合ファイルがある場合は上書きします。デフォルト:False。

--default-target TEXT

Default target for the dbt project. Mutually exclusive with --unset-default-target.

--unset-default-target

Unset the default target for the dbt project. Mutually exclusive with --default-target. Default: False.

--external-access-integration TEXT

External access integration to be used by the dbt object.

--install-local-deps

Installs local dependencies from project that don't require external access. Default: False.

--connection, -c, --environment TEXT

config.toml ファイルで定義されている接続の名前。デフォルト: デフォルト

--host TEXT

接続用のホストアドレス。接続に指定された値を上書きします。

--port INTEGER

接続のポート。接続に指定された値を上書きします。

--account, --accountname TEXT

Snowflakeアカウントに割り当てられた名前。接続に指定された値を上書きします。

--user, --username TEXT

Snowflakeに接続するユーザー名。接続に指定された値を上書きします。

--password TEXT

Snowflakeのパスワード。接続に指定された値を上書きします。

--authenticator TEXT

Snowflakeの認証コード。接続に指定された値を上書きします。

--workload-identity-provider TEXT

ワークロードIDプロバイダー(AWS、AZURE、GCP、OIDC)。接続に指定された値を上書きします。

--private-key-file, --private-key-path TEXT

Snowflake プライベートキーファイルへのパス。接続に指定された値を上書きします。

--token TEXT

Snowflake接続時に使用する OAuth トークン。

--token-file-path TEXT

Snowflake接続時に使用する OAuth トークンを含むファイルへのパス。

--database, --dbname TEXT

使用するデータベース。接続に指定された値を上書きします。

--schema, --schemaname TEXT

使用するデータベーススキーマ。接続に指定された値を上書きします。

--role, --rolename TEXT

使用するロール。接続に指定された値を上書きします。

--warehouse TEXT

使用するウェアハウス名。接続に指定された値を上書きします。

--temporary-connection, -x

Uses a connection defined with command-line parameters, instead of one defined in config. Default: False.

--mfa-passcode TEXT

多要素認証(MFA)に使用するトークン。

--enable-diag

接続診断レポートを作成するかどうか。デフォルト: false。

--diag-log-path TEXT

生成されたレポートのパス。デフォルトはシステム仮ディレクトリです。デフォルト: <system_temporary_directory>.

--diag-allowlist-path TEXT

allowlist パラメーターを含む JSON ファイルへのパス。

--oauth-client-id TEXT

Snowflake統合のためにIDプロバイダーが提供するクライアントIDの値。

--oauth-client-secret TEXT

Snowflake 統合用に ID プロバイダーが提供するクライアントシークレットの値。

--oauth-authorization-url TEXT

認証コードをドライバーに提供する ID プロバイダーエンドポイント。

--oauth-token-request-url TEXT

ドライバーにアクセストークンを供給する ID プロバイダーのエンドポイント。

--oauth-redirect-uri TEXT

URI 認証コードのリダイレクトに使用します。

--oauth-scope TEXT

ID プロバイダー承認リクエストで要求された範囲。

--oauth-disable-pkce

コード交換の証明キー (PKCE) を無効にします。デフォルト:False

--oauth-enable-refresh-tokens

実際のアクセストークンが古くなった場合に、サイレント再認証コードを有効にします。デフォルト:False

--oauth-enable-single-use-refresh-tokens

シングルユース・更新・トークンのセマンティクスにオプトインするかどうか。デフォルト:False

--client-store-temporary-credential

仮認証情報を保存します。

--format [TABLE|JSON|JSON_EXT|CSV]

出力形式を指定します。デフォルト: TABLE

--verbose, -v

ログレベル info 以上のログエントリを表示します。デフォルト: false。

--debug

ログレベル debug 以上のログ エントリを表示します。デバッグログには追加情報が含まれます。デフォルト: false。

--silent

コンソールへの中間出力をオフにします。デフォルト: false。

--enhanced-exit-codes

終了エラーコードをエラーのタイプによって区別します。デフォルト: false。

--decimal-precision INTEGER

Number of decimal places to display for decimal values. Uses Python's default precision if not specified.

--help

このコマンドのヘルプテキストを表示します。

使用上の注意

snow dbt deploy コマンドは仮ステージにローカルファイルをアップロードし、新しいオブジェクトを作成するか、新しいバージョンを作成して既存のdbtプロジェクトオブジェクトを更新します。有効なdbtプロジェクトオブジェクトには、2つのファイルが含まれている必要があります。

  • dbt_project.yml: A standard dbt configuration file that specifies the profile to use.

  • profiles.yml: A dbt connection profile definition referenced in dbt_project.yml. profiles.yaml must define the database, role, schema, and type.

    <profile_name>:
    target: dev
    outputs:
      dev:
        database: <database_name>
        role: <role_name>
        schema: <schema_name>
        warehouse: <warehouse_name>
        type: snowflake
    
    Copy

  • jaffle_shop という名前のdbtプロジェクトをデプロイします。

    snow dbt deploy jaffle_shop
    
    Copy
  • 指定されたディレクトリから jaffle_shop という名前のプロジェクトをデプロイし、dbtプロジェクトオブジェクトが既に存在する場合は上書きします。

    snow dbt deploy jaffle_shop --force --source /path/to/dbt/directory --profiles-dir ~/.dbt/
    
    Copy
  • Deploy a project named jaffle_shop from a specified directory using a custom profiles directory and enabling external access integrations:

    snow dbt deploy jaffle_shop --force --source /path/to/dbt/directory
    --profiles-dir ~/.dbt/ --default-target dev
    --external-access-integration dbthub-integration
    --external-access-integration github-integration
    
    Copy