Files
supabase/apps/studio/data/table-rows/keys.ts
T
Alaister Young 0e3bc5804b chore: remove useExecuteSqlQuery (part 1) (#30437)
* chore: remove useExecuteSqlQuery part 1

* fix invalidation

* fixes

* more fixes

* I fixed it, but tested on preview instead of local 🤦🏻

* only refetch table rows and not count on row updates

* removed unneeded invalidations and prefetched new table after create
2024-11-14 15:21:29 +08:00

13 lines
590 B
TypeScript

import type { GetTableRowsArgs } from './table-rows-query'
type TableRowKeyArgs = Omit<GetTableRowsArgs, 'table'> & { table?: { id?: number } }
export const tableRowKeys = {
tableRows: (projectRef?: string, { table, ...args }: TableRowKeyArgs = {}) =>
[projectRef, 'table-rows', table?.id, 'rows', args] as const,
tableRowsCount: (projectRef?: string, { table, ...args }: TableRowKeyArgs = {}) =>
[projectRef, 'table-rows', table?.id, 'count', args] as const,
tableRowsAndCount: (projectRef?: string, tableId?: number) =>
[projectRef, 'table-rows', tableId] as const,
}