/tsql-utils

dbt-utils for the dbt-msft family of packages

tsql-utils

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.

Compatibility

This package provides "shims" for:

Usage

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.

Installation Instructions

To make use of these TSQL adaptations in your dbt project, you must do two things:

  1. Install both and tsql-utils and any of the compatible packages listed above by them to your packages.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}
  2. Tell the supported package to also look for the tsql-utils macros by adding the relevant variables to your dbt_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.