-- This file is automatically generated. Do not update by hand.

{{ '{{' }} config(schema='{{app}}', alias='{{relation.alias}}') {{ '}}' }}
{% set soft_del_ns = {'found':false} %}
SELECT
{% for col in relation.columns -%}
  {% set app_table = app|upper ~ '.' ~ relation.name|upper %}
  {% if app_table in redactions and col.name in redactions[app_table] -%}
    {{ redactions[app_table][col.name]|safe }} as {{ col.name|upper|indent -}}
  {% else -%}
    {{ col.name|upper|indent }}
  {%- endif -%}
  {{- ", " if not loop.last }}
  {%- if col.name|upper == raw_schema.soft_delete_column_name|upper -%}
    {%- if soft_del_ns.update({'found':true}) -%}{% endif %}
  {%- endif -%}
{%- endfor %}
FROM {{ '{{' }} source('{{raw_schema.schema_name}}', '{{relation.name}}') {{ '}}' }}
{%- if soft_del_ns.found %}
WHERE {{raw_schema.soft_delete_sql_clause()}}
{%- endif -%}
