Skip to content

Commit

Permalink
Added Support for Snowflake Secure Views.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carolus-Holman committed Sep 11, 2019
1 parent 5b29c19 commit c4288b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/snowflake/dbt/adapters/snowflake/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SnowflakeAdapter(SQLAdapter):
ConnectionManager = SnowflakeConnectionManager

AdapterSpecificConfigs = frozenset(
{"transient", "cluster_by", "automatic_clustering"}
{"transient", "cluster_by", "automatic_clustering", "secure"}
)

@classmethod
Expand Down
5 changes: 4 additions & 1 deletion plugins/snowflake/dbt/include/snowflake/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
{% endmacro %}

{% macro snowflake__create_view_as(relation, sql) -%}
create or replace view {{ relation }} as (
{%- set secure = config.get('secure', default=false) -%}
create or replace {% if secure -%}
secure
{%- endif %} view {{ relation }} as (
{{ sql }}
);
{% endmacro %}
Expand Down

0 comments on commit c4288b1

Please sign in to comment.