Skip to content

Command Line Tool to reverse engineere a snowflake table to dbt model/contract

License

Notifications You must be signed in to change notification settings

tensor365/snow2dbt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbtIcon

Snow2dbt

Command Line to reverse engineering a Snowflake Table to DBT model and SQL

Be careful this tool is under development. There's no stable release yet.

1. Installing

• From pip

pip install snow2dbt

• From Github repository

pip install https://github.com/tensor365/snow2dbt

2. Authentication

Dbt SSO

If you have already a Snowflake Connection in your profile.yml , snow2dbt will use this identity to connect to your Snowflake tenant. If you've multiple identity in your profile.yml, you can specify the profile you want by using the argument: --profile .

Standard Authentication

If you want to use a standard authentification to Snowflake, you can specify following arguments:

• Password Authentication

```bash 

--account <snowflake_accountname>
--user <snowflake_user>
--password <snowflake_password> 

```

• Keypair Authentication

Not available yet. Incoming soon

```bash

--account <snowflake_accountname>
--key <snowflake_private_key>

```

3. Reversing a Snowflake Table into model/contract

snow2dbt --target <databse>.<schema>.<table>

CLI arguments

Option Description
-l, --lower Output type names as lowercase in YAML file
--snake Convert field names to snake_case
--prefix Prefix to add to columns names (default: None)
--suffix Suffix to add to column names (default: None)
--output Destination folder for scripts. (default: target/bq2dbt)
--empty_description Add empty description property to YAML file if field description is empty (placeholder)
--tabs Use tabs instead of 4 spaces in SQL file indentation
--leading_comma Put comma at the start of line in SQL file column list instead of end of line

About

Command Line Tool to reverse engineere a snowflake table to dbt model/contract

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages