ethereum-models/macros/grant_data_share_statement.sql
Jim Myers 1c647cc896
Data Share Post Hook Run (#70)
* Add data share macro.

* modify to run share post hook for each model

Co-authored-by: Desmond Hui <desmond@flipsidecrypto.com>
2022-05-13 08:58:30 -07:00

7 lines
340 B
SQL

{% macro grant_data_share_statement(table_name, resource_type) %}
{% if target.database == 'ETHEREUM' %}
GRANT SELECT ON {{ resource_type }} ETHEREUM.CORE.{{ table_name }} TO SHARE "FLIPSIDE_ETHEREUM";
{% else %}
select 1; -- hooks will error if they don't have valid SQL in them, this handles that!
{% endif %}
{% endmacro %}