Skip to content

Commit

Permalink
Merge pull request #1743 from Carolus-Holman/feature/snowflake-secure…
Browse files Browse the repository at this point in the history
…-view-4

Feature/snowflake secure view 4
  • Loading branch information
drewbanin committed Sep 12, 2019
2 parents 1fab0ab + c4288b1 commit 5dc776f
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 5dc776f

Please sign in to comment.