mirror of
https://github.com/FlipsideCrypto/fsc-utils.git
synced 2026-02-06 10:56:49 +00:00
dynamic schema
This commit is contained in:
parent
408192bf65
commit
adda21a75f
@ -1,11 +1,11 @@
|
||||
{% macro create_udfs(drop_=False) %}
|
||||
{% macro create_udfs(drop_=False,schema="utils") %}
|
||||
{% if var("UPDATE_UDFS_AND_SPS") %}
|
||||
{% set name %}
|
||||
{{- reference_models.udf_configs() -}}
|
||||
{{- reference_models.udf_configs(schema) -}}
|
||||
{% endset %}
|
||||
{% set udfs = fromyaml(name) %}
|
||||
{% set sql %}
|
||||
CREATE schema if NOT EXISTS utils;
|
||||
CREATE schema if NOT EXISTS {{ schema }};
|
||||
{%- for udf in udfs -%}
|
||||
{{- reference_models.create_or_drop_function_from_config(udf, drop_=drop_) -}}
|
||||
{% endfor %}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
{% macro udf_configs() %}
|
||||
{% macro udf_configs(schema) %}
|
||||
|
||||
{#
|
||||
UTILITY SCHEMA
|
||||
#}
|
||||
|
||||
- name: utils.udf_hex_to_int
|
||||
- name: {{ schema }}.udf_hex_to_int
|
||||
signature:
|
||||
- [hex, STRING]
|
||||
return_type: TEXT
|
||||
@ -16,7 +16,7 @@
|
||||
HANDLER = 'hex_to_int'
|
||||
sql: |
|
||||
{{ reference_models.python_hex_to_int() | indent(4) }}
|
||||
- name: utils.udf_hex_to_int
|
||||
- name: {{ schema }}.udf_hex_to_int
|
||||
signature:
|
||||
- [encoding, STRING]
|
||||
- [hex, STRING]
|
||||
@ -30,7 +30,7 @@
|
||||
sql: |
|
||||
{{ reference_models.python_udf_hex_to_int_with_encoding() | indent(4) }}
|
||||
|
||||
- name: utils.udf_hex_to_string
|
||||
- name: {{ schema }}.udf_hex_to_string
|
||||
signature:
|
||||
- [hex, STRING]
|
||||
return_type: TEXT
|
||||
|
||||
Loading…
Reference in New Issue
Block a user