mirror of
https://github.com/FlipsideCrypto/polygon-models.git
synced 2026-02-06 13:01:46 +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>
24 lines
457 B
PL/PgSQL
24 lines
457 B
PL/PgSQL
{% macro create_udtf_get_base_table(schema) %}
|
|
create or replace function {{ schema }}.udtf_get_base_table(max_height integer)
|
|
returns table (height number)
|
|
as
|
|
$$
|
|
with base as (
|
|
select
|
|
row_number() over (
|
|
order by
|
|
seq4()
|
|
) as id
|
|
from
|
|
table(generator(rowcount => 100000000))
|
|
)
|
|
select
|
|
id as height
|
|
from
|
|
base
|
|
where
|
|
id <= max_height
|
|
$$
|
|
;
|
|
|
|
{% endmacro %} |