<aside> 📍 For Avo users, we recommend to continuing to manage your tracking plan in Avo.
Use a Reflekt project to template and version control dbt packages that model and document the events in your Avo plan.
</aside>
Run reflekt pull --name my-plan
to pull a tracking plan from Avo into your local Reflekt project. This creates a codified version of your plan.
Run reflekt dbt --name my-plan --schema my_app_web
to template a Reflekt dbt package that models and documents the events in your tracking plan.
Push your changes to the GitHub repo where your Reflekt project is saved.
Open a pull request to merge your templated Reflekt dbt package (e.g. reflekt_my_project
) to your main branch. Request a review from team. Merge to the main branch when approved.
In your dbt project, reference the Reflekt dbt package.
# packages.yml in your dbt project
packages:
- package: dbt-labs/dbt_utils
version: 0.8.5
- git: "<https://github.com/my-github-user/reflekt-my-project>"
subdirectory: "dbt-packages/reflekt_my_project"
revision: v0.1.0__reflekt_my_project # Git tag created by 'reflekt dbt'
Run dbt deps
in your dbt project to pull your Reflekt dbt package from GitHub.
❯ dbt deps
00:44:53 Running with dbt=1.1.0
00:45:01 Installing dbt-labs/dbt_utils
00:45:02 Installed from version 0.8.5
00:45:02 Updated version available: 0.8.6
00:45:02 Installing <https://github.com/my-github-user/reflekt-my-project>
00:45:04 Installed from revision v0.1.0__reflekt_my_project
00:45:04 and subdirectory dbt-packages/reflekt_my_project
Use the models from your Reflekt dbt package in your dbt project!
-- daily_orders.sql
{{
config(
materialized = 'view',
)
}}
with
reflekt_pkg_model as (
select * from {{ ref('reflekt_my_app_web__order_completed') }}
),
final as (
select
tstamp::date as date_day,
count(*) as count_orders
from reflekt_pkg_model
group by 1
)
select * from final