❄️
Data Flakes

Back

“I love managing stored procedures by copying text from VS Code into the Snowflake web UI,” said no one ever.

Snowflake’s Native Git Integration (GA as of late 2024/early 2025) finally solves the “Last Mile” problem of deployment. We can now connect Snowflake directly to a GitHub, GitLab, or Azure DevOps repository.

Concepts: Git Repository Stage#

The core object is the Git Repository. It acts like a special Stage.

-- Create an API Integration for authentication
CREATE OR REPLACE API INTEGRATION git_api_int
  API_PROVIDER = git_https_api
  API_ALLOWED_PREFIXES = ('https://github.com/my-org/my-repo')
  ALLOWED_AUTHENTICATION_SECRETS = (my_github_secret)
  ENABLED = TRUE;

-- Create the Repository Object
CREATE OR REPLACE GIT REPOSITORY my_repo
  API_INTEGRATION = git_api_int
  ORIGIN = 'https://github.com/my-org/my-repo';
sql

Once created, you can “fetch” the latest code from valid branches.

ALTER GIT REPOSITORY my_repo FETCH;
sql

Running Code from Git#

This is where it gets cool. You can execute scripts directly from the repo.

-- Execute a DDL script
EXECUTE IMMEDIATE FROM @my_repo/branches/main/scripts/setup_tables.sql;
sql

Integrating with Python/Snowpark#

For Snowpark, this is a game changer. Instead of uploading zip files to stages manually, you can import Python modules directly from the repo.

CREATE OR REPLACE PROCEDURE my_proc()
  RETURNS STRING
  LANGUAGE PYTHON
  RUNTIME_VERSION = 3.10
  IMPORTS = ('@my_repo/branches/main/src/my_utils.py')
  HANDLER = 'my_utils.run_logic';
python

A Modern CI/CD Workflow#

  1. Developer: Pushes code to feature/new-pipeline in GitHub. Defines deployment.sql.
  2. Pull Request: Code is reviewed and merged to main.
  3. GitHub Action (CI):
    • Logs into Snowflake.
    • Runs ALTER GIT REPOSITORY my_repo FETCH.
    • Runs EXECUTE IMMEDIATE FROM @my_repo/branches/main/deployment.sql.

No more third-party tools (like Schemachange or Terraform) are strictly necessary for simple deployments, although they still add value for state management. The delivery mechanism, however, is now native.

Conclusion#

Native Git Integration brings Snowflake into the modern DevOps era. It creates a tightly coupled, secure link between your version control and your data platform, eliminating manual errors and “drift”.

Disclaimer

The information provided on this website is for general informational purposes only. While we strive to keep the information up to date and correct, there may be instances where information is outdated or links are no longer valid. We make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk.