mirror of
https://github.com/FlipsideCrypto/polygon-models.git
synced 2026-02-06 20:06:44 +00:00
* Models for blocks stream * add the utils for post_hook * add the bronze streamline schema * Update * Update * Duplicate bug fix * Chainhead route fix Co-authored-by: yulike <xiuyangguan@gmail.com>
36 lines
759 B
SQL
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 %}
|