[go: up one dir, main page]

Skip to content

datnguye/dbt-translate

Repository files navigation

dbt-translate

dbt-translate

dbt MIT License GitHub repo

conitinous integration test

✨ Helps to convert Numbers to Words

Currently supporting:

dwh dwh

language

Installation

# packages.yml
packages:
  - package: datnguye/dbt-translate
    version: [">=1.0.0", "<1.1.0"]

OR:

# packages.yml
packages:
  - git: "https://github.com/datnguye/dbt-translate.git"
    revision: 1.0.0

Register the common schema where holding the built-in stored procedure:

# dbt_project.yml
vars:
  num2words_schema: common_schema # by default it takes `target.schema

Add on-run-start hook to deploy SPROCs

# dbt_project.yml / Add your conidition to hook as you go
on-run-start:
  - >
    {{ dbt_translate.compile_money_to_words() }}

Usage

# model_something.sql
with test as (
    select 2000 as amount
    union all
    select 9999 as amount
)
select  amount
        ,{{ dbt_translate.money_to_words('amount', 'en') }} as amount_in_word
from    test
/*
amount  amount_in_word
------  ---------------------------------------
2000    two thousand
9999    nine thousand nine hundred ninety-nine
*/

Contributing ✨

If you've ever wanted to contribute to this tool, and a great cause, feel free to create your Pull Request 💖

Check CONTRIBUTING.md for more details!

buy me a coffee