Snowflake connectivity with GIT
Asked Answered
D

6

6

Is there any way we can connect snowflake with GIT for version control. With the help of that, we can maintain version of our merge statement and any other sql script in GIT.

Drusi answered 6/7, 2020 at 19:56 Comment(2)
I believe Snowflake's new worksheet UI Snowsight is supposed to get native Git integration in the future. But for now, we are storing all our objects in Git and using Redgate's Flyway to migrate the code to multiple environments through Azure DevOps. It works really well for us.Threw
This post is over 3 years old so I'll point out that there is now a tool called schemachange (github.com/Snowflake-Labs/schemachange) which is specific to Snowflake, provided (though not supported) by Snowflake Labs, and is heavily influenced by Flyway.Reunionist
S
1

Yes! One way to do this is to store your Snowflake SQL code in a file/files with the sql extension (i.e. filename.sql). You can add those files to a GIT repo and track them in the repo accordingly.

Solution answered 6/7, 2020 at 20:16 Comment(2)
Any other way where we can directly integrate snowflake with GITDrusi
It's a fairly popular feature request you can upvote here (search on GIT): community.snowflake.com/s/ideas Although it's not a GIT integration, you might also try Snowsight, which is a Snowflake feature in Public Preview and may meet some of your needs: docs.snowflake.com/en/user-guide/ui-snowsight.htmlBotzow
G
3

There is now a VSCode extension for Snowflake. I'm able to connect vscode to our repo (Azure DevOps in my case) and Snowflake. It's got some nice features too like being able to easily cycle through past queries (including query results) and gives the same level of detail (or more) than the Snowflake UI.

The extension is called Snowflake - from Snowflake.

Gamages answered 3/2, 2023 at 16:4 Comment(2)
Please add the name of the extension as well.Demurral
Snowflake now has a 'repository stage' too. docs.snowflake.com/en/developer-guide/git/git-overviewGamages
P
2

DBeaver has git integration and is the best solution my team has found for version control with Snowflake. It's not perfect but it allows you to run your scripts against Snowflake and then push your SQL code to a git repository through the app UI or command line.

Pencel answered 8/2, 2022 at 14:41 Comment(0)
P
2

Other answers help with using an IDE as a go-between for git and Snowflake. These projects could be useful also:

https://medium.com/snowflake/snowflake-vs-code-sql-tools-and-github-7eab915e10cb

  • use VSCode as the IDE with a useful snowflake extension

https://github.com/Snowflake-Labs/schemachange

  • manage schema changes as script in git, deploy them with CI/CD

https://github.com/Snowflake-Labs/sfsnowsightextensions#get-sfworksheets

  • the missing feature of SnowSight -- export worksheets
Procora answered 3/11, 2022 at 3:33 Comment(0)
W
2

Snowflake has in public preview a git integration. You can find the information in their documentation: https://docs.snowflake.com/en/developer-guide/git/git-setting-up I hope this helps.

Wanids answered 17/4 at 13:40 Comment(0)
S
1

Yes! One way to do this is to store your Snowflake SQL code in a file/files with the sql extension (i.e. filename.sql). You can add those files to a GIT repo and track them in the repo accordingly.

Solution answered 6/7, 2020 at 20:16 Comment(2)
Any other way where we can directly integrate snowflake with GITDrusi
It's a fairly popular feature request you can upvote here (search on GIT): community.snowflake.com/s/ideas Although it's not a GIT integration, you might also try Snowsight, which is a Snowflake feature in Public Preview and may meet some of your needs: docs.snowflake.com/en/user-guide/ui-snowsight.htmlBotzow
F
1

This is an age old question when dealing with databases and how one should go about versioning them. Unfortunately, no database really integrates directly into any VCS that I'm aware of.

My team has settled on using dbt. This essentially turns the database into a series of text files that are easily integrated with git. The short of it is that you edit your models as local text files, and then use dbt run to put these models into Snowflake itself. This is kind of nice as you can configure separate environments such as dev and prod.

Freud answered 7/7, 2020 at 23:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.