SnowDDL
  • 👋Introduction
  • ðŸšĐGetting started
  • 📋Main features
  • ðŸŠĪSnowDDL vs. Declarative DCM
  • In-depth guides
    • 👓Object identifiers
    • 📐Data types
    • ðŸ“ĶObject types
    • 🎭Role hierarchy
    • 🚧Permission model
    • ðŸ”ĶOther guides
      • Administration user
      • Integrations
      • Inbound shares
      • Object OWNERSHIP
      • Safe & unsafe DDL
      • Dependency management
      • Short hash explained
      • Env Prefix explained
      • Team workflow
      • Limitations & workarounds
      • Fivetran
      • Airbyte
      • Encrypt user passwords
      • Iceberg Tables
  • Basic usage (CLI + YAML)
    • ðŸ’ŧCLI interface
    • ðŸ“ĶYAML configs
      • ACCOUNT PARAMETER
      • ACCOUNT POLICY
      • AGGREGATION POLICY
      • ALERT
      • AUTHENTICATION POLICY
      • BUSINESS ROLE
      • DATABASE
      • DYNAMIC TABLE
      • EVENT TABLE
      • EXTERNAL ACCESS INTEGRATION
      • EXTERNAL FUNCTION
      • EXTERNAL TABLE
      • FILE FORMAT
      • FUNCTION
      • HYBRID TABLE
      • ICEBERG TABLE
      • MASKING POLICY
      • MATERIALIZED VIEW
      • NETWORK POLICY
      • NETWORK RULE
      • PERMISSION MODEL
      • PIPE
      • PLACEHOLDER
      • PROCEDURE
      • PROJECTION POLICY
      • RESOURCE MONITOR
      • ROW ACCESS POLICY
      • SCHEMA
      • SECRET
      • SEQUENCE
      • SHARE (outbound)
      • STAGE
      • STAGE FILE
      • STREAM
      • TABLE
      • TASK
      • TECHNICAL ROLE
      • USER
      • VIEW
      • WAREHOUSE
    • 🏷ïļYAML placeholders
    • 📎YAML tag !include
    • 🔐YAML tag !decrypt
  • Single DB
    • ðŸĶ€Overview
  • Advanced usage (Python)
    • ⚙ïļProgrammatic config
    • 🐍Architecture overview
      • ðŸ”ĩBlueprints
      • ðŸŸĢConfig
      • 🟠Parsers
      • ðŸŸĒResolvers
      • ðŸ”īEngine
    • 🏗ïļQuery builder & formatter
  • Breaking changes log
    • 0.45.0 - March 2025
    • 0.41.0 - January 2025
    • 0.37.0 - December 2024
    • 0.36.0 - November 2024
    • 0.33.0 - October 2024
    • 0.27.0 - May 2024
  • Links
    • GitHub repository
    • PyPI package
    • YouTube tutorials
    • Changelog
    • LinkedIn profile
Powered by GitBook
On this page
  • Configuration
  • Placeholders from command line argument
  • Technical placeholders
  • Usage notes
  1. Basic usage (CLI + YAML)

YAML placeholders

SnowDDL supports placeholders in YAML configs. Placeholder format is similar to GitHub Actions:

${{ <placeholder> }}

Examples:

my_warehouse:
  size: ${{ wh_size }}
  auto_suspend: ${{ wh_auto_suspend }}
url: s3://${{ bucket_name }}/my_path/
storage_integration: test_storage_integration
file_format: test_avro_format

Configuration

Placeholders should be defined in config path: /placeholder.yaml

Example:

wh_size: SMALL
wh_auto_suspend: 300
bucket_name: dev-test-bucket

Additionally, you may specify a path to file with environment-specific placeholder values. For example, you may use it to override bucket_name from dev-test-bucket in DEV environment to prod-test-bucket in PROD environment.

bucket_name: prod-test-bucket

CLI option is --placeholder-path :

snowddl \
-c <config> \
-a <account_identifier> \
-u <user> \
-p <password> \
--placeholder-path=<path_to_custom_placeholder.yaml>
apply

Placeholders from command line argument

Alternatively, it is possible to specify custom placeholder values using CLI argument --placeholder-values. This argument accepts JSON string. For example:

snowddl \
-c <config> \
-a <account_identifier> \
-u <user> \
-p <password> \
--placeholder-values="{'bucket_name': 'prod-test-bucket'}"
apply

Data types of JSON values are important!

For example, placeholders for BOOLEAN values should be specified as JSON true or false without quotes. Numeric values should not have quotes as well.

Technical placeholders

A small number of placeholders are created automatically and always available. These placeholders can still be overloaded by config if necessary.

Usage notes

  1. Data types of placeholder values are preserved. You may use integers, booleans, floats, etc.

  2. All placeholders should be defined explicitly. Undefined placeholders will raise an exception and stop further execution to prevent an accidental damage.

PreviousWAREHOUSENextYAML tag !include

Last updated 1 year ago

env_prefix (str) - contains current value. For example, if env prefix is ALICE, this placeholder will contain ALICE__. It should be used as a part of raw SQL fragments when it is necessary to access object in another database. It is especially useful for definitions. For example: ${{ env_prefix }}db_name.schema_name.object_name.

target_db (str) - contains target database name in , including env prefix. Requires --target-db CLI argument to be set explicitly.

🏷ïļ
env prefix
VIEW
SingleDB mode