Initial publish of dbt_f2dq (f2dq) package v0.12.1.
Clean package repo for Gitea installs via packages.yml git URL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
{% macro to_json_string_value_or_null(column) %}
|
||||
(
|
||||
case
|
||||
when {{ column }} is null then 'null'
|
||||
else '"' ||
|
||||
regexp_replace(
|
||||
replace(cast({{ column }} as {{ string_type() }}), '"', {{ escape_seq_for_json('"') }}),
|
||||
'\n', {{ quote_new_line() }} {% if target.type in postgres_type_db() %}, 'g' {% endif %}
|
||||
) || '"'
|
||||
end
|
||||
)
|
||||
{% endmacro %}
|
||||
|
||||
{% macro to_single_json(columns) %}
|
||||
'{' ||
|
||||
{%- for column in columns %}
|
||||
'"{{ column }}": ' ||
|
||||
{{ to_json_string_value_or_null(column) }}
|
||||
{%- if not loop.last %} || ',' || {%- endif %}
|
||||
{%- endfor %}
|
||||
|| '}'
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user