Git Integration in Snowflake ❄️

DataGeeks
3 min readApr 8, 2024

This week, Snowflake unveiled another exciting feature: seamless integration with Git repositories. With this update, Snowflake users can now effortlessly execute SQL files directly from the repository within the Snowflake platform.

In this article, you will explore how effortlessly we can achieve Git integration with Snowflake’s latest feature, the GIT REPOSITORY stage.

For this initial public preview, you can only access and read files from your Git repository. however, altering or committing those files to the Git repository is not yet supported. Stay tuned for future updates.

Implementation

Gitlab Token Creation: The initial step involves generating a GitLab access token, which can be done via the GitLab user interface. Navigate to the repository settings to locate the Access Tokens option. This token serves to authenticate requests from Snowflake.

Select a role higher or equal to DEVELOPER else you might get some errors.

Snowflake SECRET Creation: We need to store the Access Token and Token Name in the Snowflake and use that secret later in the API integration

CREATE OR REPLACE SECRET gitlab_secret
TYPE = password
USERNAME = 'DATAGEEKS'. ---token name
PASSWORD = 'glpat-yu-GssK1T7ddYpJmAdeR__'; -- Access token

--

--

DataGeeks
DataGeeks

Written by DataGeeks

A data couple, Having 15 years of combined experience in data and love to share the knowledge about Data