Skip to content

[Feature] Add the ability to create tables and views with a row access policy. #697

Open
@greenantim2

Description

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt-snowflake functionality, rather than a Big Idea better suited to a discussion

Describe the feature

I would like to be able to specify a row access policy to apply to a table or view when it is created. For example add a config option such as row_access_policy where you would specify the policy name and the column that it applies to.

{{
config(
row_access_policy='test_db.security.tenant_row_access__policy ON (tenantid)'
)
}}

When the table or view is compiled the resulting code would look like

CREATE TABLE
test_db.published.SalesData
WITH ROW ACCESS POLICY test_db.security.tenant_row_access__policy ON (tenantid)
AS ( ...

Describe alternatives you've considered

I've considered using a post hook to apply the row access policy after the table has been created. The problem with this approach is that there is a slight delay after the table has been created and before the row access policy has been applied where all of the data is exposed to the consumer. This is not a viable option as it exposes sensitive data.

Who will this benefit?

Anyone who uses row access policies in Snowflake.

Are you interested in contributing this feature?

I would be willing to test any changes, I'm not sure that I have the ability to make the changes.

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions