- dbt က YAML ကို နေရာမျိုးစုံမှာ အသုံးပြုပါတယ်။ YAML ရဲ့ array , dictionary , string စသဖြင့် ကြေညာပုံတွေကို မရင်းနှီးသေးဘူး ဆိုရင် [Official YAML website](https://yaml.org/spec/1.2.2/) မှာ လေ့လာစေချင်ပါတယ်။ - YAML Cheatsheet - [Link](https://habezai.github.io/home/cheatsheets/YAML.html) , YAML Refcard - [Link](https://yaml.org/refcard.html) - YAML အကြောင်း - [[YAML]] ## dbt_project.yml - Project Configuration (သို့မဟုတ်) အရေးကြီးတဲ့ core setting တွေ အတွက် အသုံးပြုပါတယ်။ အထူးသဖြင့် configuration ကို Model တစ်ခုချင်းဆီ လိုက်မကြေညာတော့ပဲ folder လိုက် management လုပ်ချင်တဲ့အခါမျိုးမှာ အသုံးပြုပါတယ်။ - Project root directory မှာ `dbt_project.yml` file ကို သိမ်းဆည်းပါတယ်။ dbt project တိုင်းမှာ ဒီဖိုင် ရှိဖို့ လိုအပ်ပါတယ်။ - Project အတွက် အရေးကြီးတဲ့ configuration တွေ - ဥပမာ `project_name`, `version` , ချိတ်ဆက်မယ့် `profile` စသဖြင့် ပါတယ်။ အသေးစိတ်ကို [Documentation](https://docs.getdbt.com/reference/dbt_project.yml#example) မှာ ဆက်ဖတ်ပါ။ - dbt_project.yml ဖိုင်ထဲမှာ folder name နဲ့ config ကို ချိတ်ဆက်ဖို့အတွက် `+` prefix ကို အသုံးပြုပါတယ်။ ## profiles.yml - မိမိ ချိတ်ဆက်လိုတဲ့ Database/Data Warehouse Connections များကို manage ပြုလုပ်ဖို့ အသုံးပြုပါတယ်။ - `profiles.yml` ကို bigquery က ဘယ်လို ၊ ဘယ်နေရာတွေမှာ လိုက်ရှာသလဲ။ ရှာဖွေမှု ဦးစားပေး အစဥ်လိုက် (နံပါတ်စဥ်) အတိုင်း မှတ်သားနိုင်ပါတယ်။ [Ref](https://docs.getdbt.com/docs/core/connect-data-platform/connection-profiles#advanced-customizing-a-profile-directory) 1. `--profiles-dir` option နဲ့ command line မှာ ကြေညာထားတဲ့ နေရာ 2. `DBT_PROFILES_DIR` environment variable နဲ့ ကြေညာထားတဲ့ နေရာ 3. လက်ရှိ dbt project working directory (root) 4. `~/.dbt/` directory (for MacOS or Linux) သို့မဟုတ် `C:\Users\<user_name>\.dbt\` directory (for Window) နေရာ - လက်ရှိ project မှာ ဘယ်နေရာက `profiles.yml` ကို အသုံးပြုနေသလဲ ဆိုတာကို စစ်ဆေးချင်ရင် ဒီ dbt command ကို အသုံးပြုပါ။ ```console dbt debug --config-dir ``` - အရေးကြီးတာက ဘယ်နေရာမှာပဲ ထားထား `profiles.yml` ဆိုတဲ့ filename ကို မှားယွင်းပြီး မပေးမိဖို့ လိုပါတယ်။ - အပေါ်မှာ ဖော်ပြခဲ့တဲ့ နံပါတ် (၁) `--profiles-dir` option ကို အသုံးပြုနည်း ```console dbt run --profiles-dir path/to/directory ``` - အပေါ်မှာ ဖော်ပြခဲ့တဲ့ နံပါတ် (၂) `DBT_PROFILES_DIR` ကို environment variable အဖြစ် MacOS (သို့) Linux ပေါ်မှာ ကြေညာနည်း။ - Window အတွက်ကတော့ Setting ထဲကနေ Environment Variable ကြေညာနည်းကို ဒီ [link](https://www.computerhope.com/issues/ch000549.htm) မှာ ဖတ်ကြည့်ပါ။ ```console export DBT_PROFILES_DIR=path/to/directory ``` # References - [Profiles.yml by dbt Official Documentation](https://docs.getdbt.com/docs/core/connect-data-platform/profiles.yml) - [Complete Guide to dbt File Structure & YAML Configuration](https://dataverse-chronicles.blogspot.com/2025/06/the-complete-guide-to-dbt-data-build.html) by Dataverse-Chronicles