Skip to content

Commit cdabea4

Browse files
authored
Merge pull request #34 from supabase-community/fix/edge-function-logs
fix: error when fetching edge function logs
2 parents 0ed68e4 + 6cd4a77 commit cdabea4

File tree

1 file changed

+8
-5
lines changed
  • packages/mcp-server-supabase/src

1 file changed

+8
-5
lines changed

packages/mcp-server-supabase/src/logs.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export function getLogQuery(
2424
`;
2525
case 'branch-action':
2626
return stripIndent`
27-
select workflow_run, workflow_run_logs.timestamp, id, event_message from workflow_run_logs
28-
order by timestamp desc
29-
limit ${limit}
30-
`;
27+
select workflow_run, workflow_run_logs.timestamp, id, event_message from workflow_run_logs
28+
order by timestamp desc
29+
limit ${limit}
30+
`;
3131
case 'postgres':
3232
return stripIndent`
3333
select identifier, postgres_logs.timestamp, id, event_message, parsed.error_severity from postgres_logs
@@ -38,7 +38,10 @@ export function getLogQuery(
3838
`;
3939
case 'edge-function':
4040
return stripIndent`
41-
select * from function_logs
41+
select id, function_edge_logs.timestamp, event_message, response.status_code, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version from function_edge_logs
42+
cross join unnest(metadata) as m
43+
cross join unnest(m.response) as response
44+
cross join unnest(m.request) as request
4245
order by timestamp desc
4346
limit ${limit}
4447
`;

0 commit comments

Comments
 (0)