cosmos-models/macros/streamline/streamline_udfs.sql
Ryan-Loofy 3bfdba7ebf
Initial commit for Cosmos DBT Project (#1)
* Initial commit for Cosmos DBT Project

* Add gitignore

* Removed dbt packages

* Removed dbt logs

* Delete target

* Remove DS_Stores

* Delete ds_store
2022-11-09 09:19:00 -05:00

19 lines
900 B
SQL

{% macro create_udf_get_cosmos_blocks() %}
CREATE
OR REPLACE EXTERNAL FUNCTION streamline.udf_get_cosmos_blocks(
json variant
) returns text api_integration = aws_cosmos_api AS {% if target.name == "prod" %}
'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_cosmos_blocks'
{% else %}
'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_cosmos_blocks'
{%- endif %};
{% endmacro %}
{# {% macro create_udf_get_cosmos_chainhead() %}
CREATE EXTERNAL FUNCTION IF NOT EXISTS streamline.udf_get_chainhead() returns variant api_integration = aws_cosmos_api AS {% if target.name == "prod" %}
'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/get_cosmos_chainhead'
{% else %}
'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/get_cosmos_chainhead'
{%- endif %};
{% endmacro %} #}