mirror of
https://github.com/FlipsideCrypto/fsc-utils.git
synced 2026-02-06 10:56:49 +00:00
Merge pull request #5 from FlipsideCrypto/AN-3326/datashare-exclude-test-schema
An 3326/datashare exclude test schema
This commit is contained in:
commit
772d0001fe
@ -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 -%}
|
||||
@ -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 %}
|
||||
Loading…
Reference in New Issue
Block a user