MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / extractOperation

Function extractOperation

packages/core/src/integrations/supabase.ts:177–199  ·  view source on GitHub ↗
(method: string, headers: Record<string, string> = {})

Source from the content-addressed store, hash-verified

175 * @returns The database operation type ('select', 'insert', 'upsert', 'update', or 'delete')
176 */
177export function extractOperation(method: string, headers: Record<string, string> = {}): string {
178 switch (method) {
179 case 'GET': {
180 return 'select';
181 }
182 case 'POST': {
183 if (headers['Prefer']?.includes('resolution=')) {
184 return 'upsert';
185 } else {
186 return 'insert';
187 }
188 }
189 case 'PATCH': {
190 return 'update';
191 }
192 case 'DELETE': {
193 return 'delete';
194 }
195 default: {
196 return '<unknown-op>';
197 }
198 }
199}
200
201/**
202 * Translates Supabase filter parameters into readable method names for tracing

Callers 2

supabase.test.tsFile · 0.90
applyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected