Merge pull request #5 from FlipsideCrypto/AN-3326/datashare-exclude-test-schema

An 3326/datashare exclude test schema
This commit is contained in:
Julius Remigio 2023-05-25 15:28:48 -07:00 committed by GitHub
commit 772d0001fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -158,3 +158,17 @@
{{- "BEGIN\n" ~ (combined_ddl | join("\n")) ~ "\nEND" -}}
{%- endmacro -%}
{% macro get_exclusion_schema() %}
{#
Return a list of schemas to exclude from the data shares
#}
{% set schema = {} %}
{% for key, value in graph.nodes.items() -%}
{%
if key.startswith("test.") or value.schema.startswith("_")
-%}
{% do schema.update({value.schema:None}) %}
{%- endif %}
{%- endfor %}
{{- schema.keys() | list | tojson -}}
{%- endmacro -%}

View File

@ -10,11 +10,13 @@
SELECT
$${{- fsc_utils.generate_datashare_ddl() -}}$$ AS ddl,
md5(ddl) AS ddl_hash,
sysdate() as ddl_created_at
sysdate() as ddl_created_at,
{{ fsc_utils.get_exclusion_schema().replace('"',"'") }} as exclusion_schema
{% else %}
SELECT
null as ddl,
null as ddl_hash,
null as ddl_created_at
null as ddl_created_at,
null as exclusion_schema
from dual limit 0
{% endif %}