mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 11:06:45 +00:00
Stream 97 blocks assembly (#134)
* added clone purge fix make directive * fixed json parsing for get blocks history * added aws_lambda_role envar to undo_clone directive | added database grants to lambda role * removed debug logs --------- Co-authored-by: shah <info@shahnewazkhan.ca>
This commit is contained in:
parent
76d5ef0dd9
commit
4a1596b0d0
12
Makefile
12
Makefile
@ -2,6 +2,7 @@ SHELL := /bin/bash
|
||||
|
||||
# set default target
|
||||
DBT_TARGET ?= sbx
|
||||
AWS_LAMBDA_ROLE ?= aws_lambda_flow_api_sbx
|
||||
|
||||
dbt-console:
|
||||
docker-compose run dbt_console
|
||||
@ -19,4 +20,13 @@ udfs:
|
||||
--vars '{"UPDATE_UDFS_AND_SPS":True}' \
|
||||
--profile flow \
|
||||
--target $(DBT_TARGET) \
|
||||
--profiles-dir ~/.dbt/
|
||||
--profiles-dir ~/.dbt/
|
||||
|
||||
grant-streamline-privileges:
|
||||
dbt run-operation grant_streamline_privileges \
|
||||
--profile flow \
|
||||
--target $(DBT_TARGET) \
|
||||
--profiles-dir ~/.dbt/ \
|
||||
--args '{role: $(AWS_LAMBDA_ROLE)}'
|
||||
|
||||
undo_clone_purge: sl-flow-api udfs grant-streamline-privileges
|
||||
@ -94,10 +94,11 @@
|
||||
{{ result_var }}
|
||||
{% endmacro %}
|
||||
|
||||
-- macro used to select priveleges on all views/tables in a target chema to a role
|
||||
{% macro grant_select(role) %}
|
||||
-- macro used to grant streamline priveleges to a role
|
||||
{% macro grant_streamline_privileges(role) %}
|
||||
{{ log("Granting privileges to role: " ~ role, info=True) }}
|
||||
{% set sql %}
|
||||
grant usage on database {{ target.database }} to role {{ role }};
|
||||
grant usage on schema {{ target.schema }} to role {{ role }};
|
||||
grant select on all tables in schema {{ target.schema }} to role {{ role }};
|
||||
grant select on all views in schema {{ target.schema }} to role {{ role }};
|
||||
|
||||
@ -22,7 +22,7 @@ SELECT
|
||||
PARSE_JSON(
|
||||
CONCAT(
|
||||
'{"grpc": "proto3",',
|
||||
'"method": "get_block_by_height',
|
||||
'"method": "get_block_by_height",',
|
||||
'"block_height":"',
|
||||
block_height :: INTEGER,
|
||||
'"}'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user