Skip to content

Commit

Permalink
Add back code lost in merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Jan 25, 2021
1 parent 44220ce commit 557bf47
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,3 @@
{% do log('No cleanup necessary, skipping', info = true) %}
{# noop #}
{% endmacro %}

{% macro snowflake__cleanup_external() %}

{% set unset_autocommit %}
alter user {{ target.user }} unset autocommit;
{% endset %}

{% do log('Unsetting autocommit parameter for user ' ~ target.user, info = true) %}
{% do run_query(unset_autocommit) %}

{% endmacro %}
10 changes: 10 additions & 0 deletions integration_tests/macros/plugins/snowflake/cleanup_external.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% macro snowflake__cleanup_external() %}

{% set unset_autocommit %}
alter user {{ target.user }} unset autocommit;
{% endset %}

{% do log('Unsetting autocommit parameter for user ' ~ target.user, info = true) %}
{% do run_query(unset_autocommit) %}

{% endmacro %}
7 changes: 7 additions & 0 deletions integration_tests/macros/plugins/snowflake/prep_external.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@
{% do log('Creating external stage ' ~ external_stage, info = true) %}
{% do run_query(create_external_stage) %}

{% set set_autocommit_false %}
alter user {{ target.user }} set autocommit = false;
{% endset %}

{% do log('Turning off autocommit for user ' ~ target.user, info = true) %}
{% do run_query(set_autocommit_false) %}

{% endmacro %}

0 comments on commit 557bf47

Please sign in to comment.