forked from dbt-labs/dbt-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
current_timestamp.sql
38 lines (28 loc) · 1.08 KB
/
current_timestamp.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{% macro current_timestamp() -%}
{{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}
{%- endmacro %}
{% macro default__current_timestamp() %}
current_timestamp::{{dbt_utils.type_timestamp()}}
{% endmacro %}
{% macro redshift__current_timestamp() %}
getdate()
{% endmacro %}
{% macro bigquery__current_timestamp() %}
current_timestamp
{% endmacro %}
{% macro current_timestamp_in_utc() -%}
{{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}
{%- endmacro %}
{% macro default__current_timestamp_in_utc() %}
{{dbt_utils.current_timestamp()}}
{% endmacro %}
{% macro snowflake__current_timestamp_in_utc() %}
convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}
{% endmacro %}
{% macro postgres__current_timestamp_in_utc() %}
(current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}
{% endmacro %}
{# redshift should use default instead of postgres #}
{% macro redshift__current_timestamp_in_utc() %}
{{ return(dbt_utils.default__current_timestamp_in_utc()) }}
{% endmacro %}