This dbt package contains macros that:
- can be (re)used across dbt projects running on Azure databases
- define implementations of dispatched macros from other packages that can be used on a database that speaks T-SQL: SQL Server, Azure SQL, Azure Synapse, etc.
This package provides "shims" for:
- dbt-utils (partial)
- dbt-date (partial)
- dbt-expectations (limited regex & timeseries functionalities)
- dbt-audit-helper (except compare_relation_columns)
Wherever a custom tsql macro exists, dbt_utils adapter dispatch will pass to tsq_utils. This means you can just do {{dbt_utils.hash('mycolumnname')}}
just like your friends with Snowflake.
To make use of these TSQL adaptations in your dbt project, you must do two things:
- Install both and
tsql-utils
and any of the compatible packages listed above by them to yourpackages.yml
packages: # and/or calogica/dbt-date; calogica/dbt-expectations; fishtown-analytics/dbt-audit-helper - package: fishtown-analytics/dbt_utils version: {SEE DBT HUB FOR NEWEST VERSION} - package: dbt-msft/tsql_utils version: {SEE DBT HUB FOR NEWEST VERSION}
- Tell the supported package to also look for the
tsql-utils
macros by adding the relevant variables to yourdbt_project.yml
vars: dbt_utils_dispatch_list: ['tsql_utils'] dbt_date_dispatch_list: ['tsql_utils'] audit_helper_dispatch_list: ['tsql_utils'] dbt_expectations_dispatch_list: ['tsql_utils']
Check dbt Hub for the latest installation instructions, or read the docs for more information on installing packages.