hts/internal/tinybird/pipes/get_active_keys.pipe

19 lines
539 B
Plaintext

VERSION 1
TOKEN "get_active_keys__v1_endpoint_read_3584" READ
NODE endpoint
SQL >
%
SELECT count(DISTINCT keyId) as keys
FROM verifications_hourly_mv
where
workspaceId = {{ String(workspaceId, required=True )}}
and apiId ={{ String(apiId) }}
{% if defined(start)%}
and time >= fromUnixTimestamp64Milli({{ Int64(start) }})
{%end if %}
{% if defined(end)%}
and time <= fromUnixTimestamp64Milli({{ Int64(end)}})
{%end if %}