Only SELECT Allowed
OnlySELECT queries are permitted. All other SQL statement types return an invalid_analytics_query_type error.
Allowed query patterns:
SELECTstatementsWITH(Common Table Expressions)UNIONEXCEPT- Subqueries
- Aggregations
- Window functions
INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE, GRANT, REVOKE
Table Access Control
Queries must reference analytics data through the public, versioned table aliases listed in the endpoint schema reference. Physical ClickHouse table names underdefault.* are unsupported, including when nested in a CTE or subquery. Attempts to use physical names or other tables such as system.* and information_schema.* return an invalid_analytics_table error.
Function Allow List
Only explicitly approved functions are allowed. Any function not on this list will be rejected with aninvalid_analytics_function error.
Allowed Functions
Aggregates
Aggregates
count, sum, avg, min, max, any, groupArray, groupUniqArray,
uniq, uniqExact, quantile, countIf, sumIfDate/Time
Date/Time
now, now64, today, toDate, toDateTime, toDateTime64,
toStartOfDay, toStartOfWeek, toStartOfMonth, toStartOfYear,
toStartOfHour, toStartOfMinute, date_trunc, formatDateTime,
fromUnixTimestamp64Milli, toUnixTimestamp64Milli, toIntervalDay,
toIntervalWeek, toIntervalMonth, toIntervalYear, toIntervalHour,
toIntervalMinute, toIntervalSecond, toIntervalMillisecond,
toIntervalMicrosecond, toIntervalNanosecond, toIntervalQuarterString
String
lower, upper, substring, concat, length, trim, startsWith,
endsWithMath
Math
round, floor, ceil, absConditional
Conditional
if, case, coalesceType Conversion
Type Conversion
toString, toInt32, toInt64, toFloat64Array
Array
has, hasAny, hasAll, arrayJoin, arrayFilterIf you need a function that’s not listed, please contact us at
support@unkey.com and we’ll review it for
inclusion.
Resource Limits
To ensure fair usage and prevent abuse, queries are subject to resource limits:Execution Limits
Query Quotas
If you need higher limits for your use case, please contact us at
support@unkey.com with details about your specific
requirements and expected query volume.