Files
supabase/apps/studio/lib/self-hosted.ts
T
Joshen Lim 63164fe165 Revert "Revert "Feature/assistant mcp"" (#36687)
* Revert "Revert "Feature/assistant mcp" (#36684)"

This reverts commit 2bff117cde.

* Attempt
2025-06-26 15:02:49 +08:00

16 lines
543 B
TypeScript

import { constructHeaders } from 'lib/api/apiHelpers'
import { post } from 'lib/common/fetch'
import { PG_META_URL } from 'lib/constants'
import type { ResponseError } from 'types'
export async function queryPgMetaSelfHosted(sql: string, headersInit?: { [prop: string]: any }) {
const headers = constructHeaders(headersInit ?? {})
const response = await post(`${PG_META_URL}/query`, { query: sql }, { headers })
if (response.error) {
return { error: response.error as ResponseError }
} else {
return { data: response }
}
}