top of page

How to generate DDL for Snowflake tables directly to GitHub using SnowHub

Updated: Aug 9, 2020

Snowflake is one of the best technologies for Cloud Data Warehouses. Developers usually create several objects such as tables and views, it means the database management can become complex as the number of objects grows.

The best way to manage those objects is to save the DDL with the CREATE TABLE statements into SCM tools (Source Control Management), however Snowflake doesn't provide this export feature; plus git commands are not known by some developers and DBAs.

SnowHub is a solution that generates the DDLs for Snowflake objects directly to GitHub, that is how it works:


SnowHub Snowflake Authentication


After connecting to SnowHub, go to the Snowflake session, inform your account, select the region and authenticate the connectivity the Multi Factor Authentication (MFA).


Go to your GitHub account and create a new private repository with the Readme file.



SnowHub GitHub authentication


Return to SnowHub and connect to your gitHub account. Select the repository recently created.


On Snowflake, verify the objects you want to version control.










SnowHub Snowflake to GitHub


Returning to SnowHub, go to the Hub page, select the Profile, Database, Schema and select all the tables and other objects you wish to generate the DDL. Select the master branch and click on export to push the code directly into GitHub.




Notice on GitHub that all the objects are exported under the Database/Schema/ObjectType folder. All the DDL files are generated with the CREATE TABLE statement



Conclusion


SnowHub is a modern tool integrated to Snowflake and GitHub and facilitates a lot the development operations (DevOps). The tool can be used for any users with a minimum git knowledge and the best part: it doesn't require a running warehouse, so there are no extra costs for your company.


About the author: Angelo Buss is a Solutions Architect and works for BRF Consulting - a Snowflake consulting partner focused on BI and Big Data.


320 views0 comments
bottom of page