Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes, reviews, and migrates Supabase logs queries against the ClickHouse logs table, including BigQuery unnest conversion.
41% 100%+59 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 9 of 22 without it.
Translate this legacy BigQuery query to Supabase Logs Explorer ClickHouse SQL: SELECT timestamp, m.request.method FROM `project.supabase_logs.edge_logs` CROSS JOIN UNNEST(metadata) AS m WHERE m.request.method = 'POST' LIMIT 50
Replaces UNNEST with direct bracket lookup log_attributes['request.method']
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
This covers wiring analytics log SQL inside apps/studio so it is branded,
routed to the right endpoint, and consistent with existing OTEL builders. Read
this when editing TypeScript that builds or runs a logs query, not when writing
a standalone query in the Logs Explorer UI.
All analytics log SQL must be a SafeLogSqlFragment built with
apps/studio/data/logs/safe-analytics-sql.ts and executed through
executeAnalyticsSql (apps/studio/data/logs/execute-analytics-sql.ts). See
safe-sql-execution (Analytics SQL section)
for the complete helper reference (safeSql, analyticsLiteral, quotedIdent,
keyword, joinSqlFragments), ESLint checks, and acceptUntrustedLogsSql
security rules.
The ClickHouse path is gated by a ConfigCat flag (useFlag(...) from 'common'
— ConfigCat, not PostHog) depending on the surface:
useFlag('otelLegacyLogs') — Logs Explorer, Logs Previewer, Single Log, Auth
Logs, SQL Editor Logs, Edge Functions statsuseFlag('otelReports') — report charts under data/reports/** and
routes/project/$ref/observability/**useUnifiedLogsBackend() (otelUnifiedLogs, defaults true) — Unified LogsKeep the BigQuery path working when the flag is off. Two helpers in
apps/studio/data/logs/logs-endpoint.ts keep the endpoint and SQL dialect
paired:
logsAllEndpointUrl(useOtel) — returns logs.all.otel when useOtel,
otherwise legacy logs.all.pickLogsQueryBuilder(useOtel, otel, bq) — selects the OTEL or BigQuery
builder while preserving the type.import { useFlag } from 'common'
Next to this one in the catalogue, plus more from the same author.