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:
Alaister Young
2024-11-18 13:15:37 +08:00
committed by GitHub
parent af4cc07a36
commit 6c592dec99
65 changed files with 640 additions and 480 deletions

View File

@@ -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,