feat: add snowflake grant support#5433
Merged
eakmanrq merged 1 commit intoddai/grantsfrom Sep 24, 2025
Merged
Conversation
755f12f to
aaed6fc
Compare
969840b to
6dc6530
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive grants support for Snowflake engine adapter, enabling database-level permission management through SQLMesh. The feature includes methods to sync grants configuration with the database, supporting common privileges like SELECT, INSERT, UPDATE for roles and users.
- Implements grants functionality for Snowflake engine adapter with sync and query methods
- Adds comprehensive test coverage for grants operations including edge cases
- Refactors integration tests to use shared grants testing utilities
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sqlmesh/core/engine_adapter/snowflake.py | Core implementation of grants support with sync and query methods |
| sqlmesh/core/engine_adapter/postgres.py | Minor type annotation fix for MAX_IDENTIFIER_LENGTH |
| sqlmesh/core/engine_adapter/risingwave.py | Explicitly disables grants support |
| sqlmesh/core/engine_adapter/_typing.py | Adds DCL type variable for grant/revoke operations |
| tests/core/engine_adapter/test_snowflake.py | Extensive unit tests for Snowflake grants functionality |
| tests/core/engine_adapter/integration/init.py | Shared utilities for creating users/roles in integration tests |
| tests/core/engine_adapter/integration/test_integration.py | Generic grants integration tests |
| tests/core/engine_adapter/integration/test_integration_postgres.py | Refactored to use shared test utilities |
| .circleci/continue_config.yml | Temporary CI configuration changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
6dc6530 to
50a903c
Compare
ea30878 to
2f3b72a
Compare
50a903c to
4041549
Compare
newtonapple
approved these changes
Sep 24, 2025
newtonapple
pushed a commit
that referenced
this pull request
Sep 29, 2025
newtonapple
pushed a commit
that referenced
this pull request
Sep 30, 2025
newtonapple
pushed a commit
that referenced
this pull request
Oct 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for Grants to Snowflake.
Also includes moving engine-adapter tests that should run for all engines that support grant to the
test_integration.pyfolder and updating it to use patterns that are expected in that file (like creating test-specific objects instead of shared global objects).