MCPcopy Index your code
hub / github.com/simstudioai/sim / useTable

Function useTable

apps/sim/hooks/queries/tables.ts:244–252  ·  view source on GitHub ↗
(workspaceId: string | undefined, tableId: string | undefined)

Source from the content-addressed store, hash-verified

242 * Fetch a single table by id.
243 */
244export function useTable(workspaceId: string | undefined, tableId: string | undefined) {
245 // rq-lint-allow: tableId is a globally-unique id; workspaceId is only an authz scope on the fetch and cannot collide across workspaces
246 return useQuery({
247 queryKey: tableKeys.detail(tableId ?? ''),
248 queryFn: ({ signal }) => fetchTable(workspaceId as string, tableId as string, signal),
249 enabled: Boolean(workspaceId && tableId),
250 staleTime: 30 * 1000,
251 })
252}
253
254/**
255 * Shared table-detail query options so non-component callers (e.g. selector

Callers 1

useTableColumnsFunction · 0.90

Calls 1

fetchTableFunction · 0.85

Tested by

no test coverage detected