aptos-models/macros/utils.sql
Jessica Huhnke 659d32fcfb
An 3099/silver (#1)
* blocks table

* transactions table

* messages & message attributes

* silver models - some tests still failing due to test data

* core models / labels / validator & token metadata

* updates to blocks & packages + formatting

* rename to tendermint

* updates

* views to tables
2023-05-09 15:27:21 -05:00

36 lines
759 B
SQL

{% macro if_data_call_function(
func,
target
) %}
{% if var(
"STREAMLINE_INVOKE_STREAMS"
) %}
{% if execute %}
{{ log(
"Running macro `if_data_call_function`: Calling udf " ~ func ~ " on " ~ target,
True
) }}
{% endif %}
SELECT
{{ func }}
WHERE
EXISTS(
SELECT
1
FROM
{{ target }}
LIMIT
1
)
{% else %}
{% if execute %}
{{ log(
"Running macro `if_data_call_function`: NOOP",
False
) }}
{% endif %}
SELECT
NULL
{% endif %}
{% endmacro %}