forked from dbt-labs/dbt-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
current_timestamp.sql
33 lines (24 loc) · 985 Bytes
/
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
{% macro current_timestamp() -%}
{{ return(adapter.dispatch('current_timestamp', packages = dbt_utils._get_utils_namespaces())()) }}
{%- 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', packages = dbt_utils._get_utils_namespaces())()) }}
{%- 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 %}