mirror of
https://github.com/supabase/supabase.git
synced 2026-05-23 10:21:37 +08:00
chore: remove useExecuteSqlQuery() part 2 (#30467)
* foreign-key-constraints * update entity-types stale time * schemas query * deprecate useExecuteSqlQuery * users count query * database size query * indexes query * keywords query * migrations query * table columns * database functions * database roles query * fdws query * replication lag query * ongoing queries query * vault secrets query * remove unneeded staleTime: 0 * max connections query * fix entity types key in tests * Some fixes --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
This commit is contained in:
@@ -55,7 +55,7 @@ export async function executeSql(
|
||||
params: {
|
||||
header: { 'x-connection-encrypted': connectionString ?? '' },
|
||||
path: { ref: projectRef },
|
||||
// @ts-ignore: This is just a client side thing to identify queries better
|
||||
// @ts-expect-error: This is just a client side thing to identify queries better
|
||||
query: {
|
||||
key:
|
||||
queryKey?.filter((seg) => typeof seg === 'string' || typeof seg === 'number').join('-') ??
|
||||
@@ -64,7 +64,7 @@ export async function executeSql(
|
||||
},
|
||||
body: { query: sql },
|
||||
headers: Object.fromEntries(headers),
|
||||
} as any) // Needed to fix generated api types for now
|
||||
})
|
||||
|
||||
if (error) {
|
||||
if (
|
||||
@@ -114,6 +114,9 @@ export async function executeSql(
|
||||
export type ExecuteSqlData = Awaited<ReturnType<typeof executeSql>>
|
||||
export type ExecuteSqlError = ResponseError
|
||||
|
||||
/**
|
||||
* @deprecated Use the regular useQuery with a function that calls executeSql() instead
|
||||
*/
|
||||
export const useExecuteSqlQuery = <TData = ExecuteSqlData>(
|
||||
{
|
||||
projectRef,
|
||||
|
||||
Reference in New Issue
Block a user