The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Fix unnest on possibly null arrays in service flow queries (#36969)
Jonathan Summers-Muirb2192f3d3f65
diff --git a/apps/studio/components/interfaces/UnifiedLogs/Queries/ServiceFlowQueries/ServiceFlow.sql.ts b/apps/studio/components/interfaces/UnifiedLogs/Queries/ServiceFlowQueries/ServiceFlow.sql.tsindex cd0690b022f..748930dc6e1 100644--- a/apps/studio/components/interfaces/UnifiedLogs/Queries/ServiceFlowQueries/ServiceFlow.sql.ts+++ b/apps/studio/components/interfaces/UnifiedLogs/Queries/ServiceFlowQueries/ServiceFlow.sql.ts@@ -153,12 +153,12 @@ const getBaseEdgeServiceFlowQuery = (logId: string, serviceType: EdgeServiceTypeleft join unnest(edge_logs_request.cf) as edge_logs_cfleft join unnest(edge_logs_request.sb) as sbleft join unnest(sb.jwt) as jwt- left join unnest(jwt.apikey) as sb_apikey- left join unnest(sb_apikey.payload) as apikey_payload- left join unnest(jwt.authorization) as auth- left join unnest(auth.payload) as authorization_payload- left join unnest(sb.apikey) as sb_apikey_outer- left join unnest(sb_apikey_outer.apikey) as sb_apikey_inner+ left join unnest(COALESCE(jwt.apikey, [])) as sb_apikey+ left join unnest(COALESCE(sb_apikey.payload, [])) as apikey_payload+ left join unnest(COALESCE(jwt.authorization, [])) as auth+ left join unnest(COALESCE(auth.payload, [])) as authorization_payload+ left join unnest(COALESCE(sb.apikey, [])) as sb_apikey_outer+ left join unnest(COALESCE(sb_apikey_outer.apikey, [])) as sb_apikey_innerWHEREel.id = '${logId}'@@ -305,12 +305,12 @@ export const getEdgeFunctionServiceFlowQuery = (logId: string): string => {left join unnest(fel_request.headers) as fel_request_headersleft join unnest(fel_request.sb) as sbleft join unnest(sb.jwt) as jwt- left join unnest(jwt.apikey) as sb_apikey- left join unnest(sb_apikey.payload) as apikey_payload- left join unnest(jwt.authorization) as auth- left join unnest(auth.payload) as authorization_payload- left join unnest(sb.apikey) as sb_apikey_outer- left join unnest(sb_apikey_outer.apikey) as sb_apikey_inner+ left join unnest(COALESCE(jwt.apikey, [])) as sb_apikey+ left join unnest(COALESCE(sb_apikey.payload, [])) as apikey_payload+ left join unnest(COALESCE(jwt.authorization, [])) as auth+ left join unnest(COALESCE(auth.payload, [])) as authorization_payload+ left join unnest(COALESCE(sb.apikey, [])) as sb_apikey_outer+ left join unnest(COALESCE(sb_apikey_outer.apikey, [])) as sb_apikey_innerleft join (SELECTfl_metadata.execution_id,