• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase-community / supabase-mcp / 16727694595

04 Aug 2025 03:41PM UTC coverage: 96.357% (+0.03%) from 96.328%
16727694595

push

github

web-flow
Merge pull request #119 from supabase-community/charis/user-agent

fix: add user-agent string to content api requests

225 of 244 branches covered (92.21%)

Branch coverage included in aggregate %.

17 of 17 new or added lines in 3 files covered. (100.0%)

2076 of 2144 relevant lines covered (96.83%)

34.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.0
/packages/mcp-server-supabase/src/logs.ts
1
import { stripIndent } from 'common-tags';
2✔
2

3
export function getLogQuery(
2✔
4
  service:
7✔
5
    | 'api'
6
    | 'branch-action'
7
    | 'postgres'
8
    | 'edge-function'
9
    | 'auth'
10
    | 'storage'
11
    | 'realtime',
12
  limit: number = 100
7✔
13
) {
7✔
14
  switch (service) {
7✔
15
    case 'api':
7✔
16
      return stripIndent`
1✔
17
        select id, identifier, timestamp, event_message, request.method, request.path, response.status_code
18
        from edge_logs
19
        cross join unnest(metadata) as m
20
        cross join unnest(m.request) as request
21
        cross join unnest(m.response) as response
22
        order by timestamp desc
23
        limit ${limit}
1✔
24
      `;
25
    case 'branch-action':
7✔
26
      return stripIndent`
1✔
27
        select workflow_run, workflow_run_logs.timestamp, id, event_message from workflow_run_logs
28
        order by timestamp desc
29
        limit ${limit}
1✔
30
      `;
31
    case 'postgres':
7✔
32
      return stripIndent`
1✔
33
        select identifier, postgres_logs.timestamp, id, event_message, parsed.error_severity from postgres_logs
34
        cross join unnest(metadata) as m
35
        cross join unnest(m.parsed) as parsed
36
        order by timestamp desc
37
        limit ${limit}
1✔
38
      `;
39
    case 'edge-function':
7✔
40
      return stripIndent`
1✔
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
45
        order by timestamp desc
46
        limit ${limit}
1✔
47
      `;
48
    case 'auth':
7✔
49
      return stripIndent`
1✔
50
        select id, auth_logs.timestamp, event_message, metadata.level, metadata.status, metadata.path, metadata.msg as msg, metadata.error from auth_logs
51
        cross join unnest(metadata) as metadata
52
        order by timestamp desc
53
        limit ${limit}
1✔
54
      `;
55
    case 'storage':
7✔
56
      return stripIndent`
1✔
57
        select id, storage_logs.timestamp, event_message from storage_logs
58
        order by timestamp desc
59
        limit ${limit}
1✔
60
      `;
61
    case 'realtime':
7✔
62
      return stripIndent`
1✔
63
        select id, realtime_logs.timestamp, event_message from realtime_logs
64
        order by timestamp desc
65
        limit ${limit}
1✔
66
      `;
67
    default:
7!
68
      throw new Error(`unsupported log service type: ${service}`);
×
69
  }
7✔
70
}
7✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc