SpinTheMic
Pro

Explain it in 60 seconds

Variables and environment variables

Data Engineering · dbt · Intermediate

How do you use vars and env_var in dbt?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • var() reads project variables set in dbt_project.yml or with --vars on the command line.
  • Useful for things like start dates or feature switches.
  • env_var() reads environment variables, often for secrets or environment-specific values.
  • env_var can take a default.
  • Secrets should come through env vars prefixed with DBT_ENV_SECRET_ so they're hidden in logs.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics