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>
引数¶
nameDBT プロジェクトの識別子。例: my_pipeline。
オプション¶
--source TEXTデプロイするdbtファイルを含むディレクトリへのパス。デフォルトは現在の作業ディレクトリです。
--profiles-dir TEXTprofiles.ymlを含むディレクトリへのパス。デフォルトは、--sourceまたは現在の作業ディレクトリで提供されるディレクトリです。
--force / --no-forceプロジェクト内に競合ファイルがある場合は上書きします。デフォルト:False。
--default-target TEXTDefault target for the dbt project. Mutually exclusive with --unset-default-target.
--unset-default-targetUnset the default target for the dbt project. Mutually exclusive with --default-target. Default: False.
--external-access-integration TEXTExternal access integration to be used by the dbt object.
--install-local-depsInstalls local dependencies from project that don't require external access. Default: False.
--connection, -c, --environment TEXTconfig.tomlファイルで定義されている接続の名前。デフォルト:デフォルト--host TEXT接続用のホストアドレス。接続に指定された値を上書きします。
--port INTEGER接続のポート。接続に指定された値を上書きします。
--account, --accountname TEXTSnowflakeアカウントに割り当てられた名前。接続に指定された値を上書きします。
--user, --username TEXTSnowflakeに接続するユーザー名。接続に指定された値を上書きします。
--password TEXTSnowflakeのパスワード。接続に指定された値を上書きします。
--authenticator TEXTSnowflakeの認証コード。接続に指定された値を上書きします。
--workload-identity-provider TEXTワークロードIDプロバイダー(AWS、AZURE、GCP、OIDC)。接続に指定された値を上書きします。
--private-key-file, --private-key-path TEXTSnowflake プライベートキーファイルへのパス。接続に指定された値を上書きします。
--token TEXTSnowflake接続時に使用する OAuth トークン。
--token-file-path TEXTSnowflake接続時に使用する OAuth トークンを含むファイルへのパス。
--database, --dbname TEXT使用するデータベース。接続に指定された値を上書きします。
--schema, --schemaname TEXT使用するデータベーススキーマ。接続に指定された値を上書きします。
--role, --rolename TEXT使用するロール。接続に指定された値を上書きします。
--warehouse TEXT使用するウェアハウス名。接続に指定された値を上書きします。
--temporary-connection, -xUses 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 TEXTallowlist パラメーターを含む JSON ファイルへのパス。
--oauth-client-id TEXTSnowflake統合のためにIDプロバイダーが提供するクライアントIDの値。
--oauth-client-secret TEXTSnowflake 統合用に ID プロバイダーが提供するクライアントシークレットの値。
--oauth-authorization-url TEXT認証コードをドライバーに提供する ID プロバイダーエンドポイント。
--oauth-token-request-url TEXTドライバーにアクセストークンを供給する ID プロバイダーのエンドポイント。
--oauth-redirect-uri TEXTURI 認証コードのリダイレクトに使用します。
--oauth-scope TEXTID プロバイダー承認リクエストで要求された範囲。
--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 INTEGERNumber 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 indbt_project.yml.profiles.yamlmust 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
例¶
jaffle_shopという名前のdbtプロジェクトをデプロイします。snow dbt deploy jaffle_shop
指定されたディレクトリから
jaffle_shopという名前のプロジェクトをデプロイし、dbtプロジェクトオブジェクトが既に存在する場合は上書きします。snow dbt deploy jaffle_shop --force --source /path/to/dbt/directory --profiles-dir ~/.dbt/
Deploy a project named
jaffle_shopfrom 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