fix(api): set x-pg-application-name for dashboard (#37048)

chore(api): set x-pg-application-name for dashboard
This commit is contained in:
Andrew Valleteau
2025-07-21 10:39:46 +02:00
committed by GitHub
parent 78419c7047
commit 4bd28eecb8
14 changed files with 132 additions and 12 deletions

View File

@@ -9,6 +9,7 @@ import {
} from 'lib/role-impersonation'
import type { ResponseError } from 'types'
import { sqlKeys } from './keys'
import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
export type ExecuteSqlVariables = {
projectRef?: string
@@ -73,7 +74,12 @@ export async function executeSql<T = any>(
const result = await post('/platform/pg-meta/{ref}/query', {
signal,
params: {
header: { 'x-connection-encrypted': connectionString ?? '' },
header: {
'x-connection-encrypted': connectionString ?? '',
'x-pg-application-name': isStatementTimeoutDisabled
? 'supabase/dashboard-query-editor'
: DEFAULT_PLATFORM_APPLICATION_NAME,
},
path: { ref: projectRef },
// @ts-expect-error: This is just a client side thing to identify queries better
query: {