Skip to content

Commit 52f8ceb

Browse files
committed
Prepend USING statement to create query of view
1 parent 8506196 commit 52f8ceb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dbt/include/singlestore/macros/common.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@
201201
{% set create_query = result[0][1] -%}
202202
{% if create_query is none or create_query is undefined -%}
203203
{%- do exceptions.raise_compiler_error('Could not get view definition for {}'.format(from_relation.identifier)) -%}
204+
{%- else -%}
205+
{% set create_query = "USING " ~ from_relation.database ~ " " ~ create_query %}
204206
{%- endif %}
205207

206208
{# Remove DEFINER=... (works if DEFINER appears only once) #}

0 commit comments

Comments
 (0)