{%- import 'syntax.sql.jinja' as syntax -%}
CREATE TABLE IF NOT EXISTS "{{ schema_name }}"."{{ table_name }}"
AS (
    SELECT * FROM (
        VALUES
        (
            {%- for type in table_cols_types -%}
            cast(NULL AS {{ type }})
            {{- syntax.comma_delineate(loop) }}
            {%- endfor -%}
        )
    )
        AS t (
            {%- for col in table_cols -%}
            "{{ col }}"
            {{- syntax.comma_delineate(loop) }}
            {%- endfor -%}
        )
    WHERE 1 = 0 -- ensure empty table
);
