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

Function fetchTableRows

apps/sim/hooks/queries/tables.ts:148–174  ·  view source on GitHub ↗
({
  workspaceId,
  tableId,
  limit,
  offset,
  after,
  filter,
  sort,
  includeTotal,
  signal,
}: TableRowsParams & { signal?: AbortSignal })

Source from the content-addressed store, hash-verified

146}
147
148async function fetchTableRows({
149 workspaceId,
150 tableId,
151 limit,
152 offset,
153 after,
154 filter,
155 sort,
156 includeTotal,
157 signal,
158}: TableRowsParams & { signal?: AbortSignal }): Promise<TableRowsResponse> {
159 const response = await requestJson(listTableRowsContract, {
160 params: { tableId },
161 query: {
162 workspaceId,
163 limit,
164 offset,
165 after,
166 filter: filter ?? undefined,
167 sort: sort ?? undefined,
168 includeTotal,
169 },
170 signal,
171 })
172 const { rows, totalCount } = response.data
173 return { rows, totalCount }
174}
175
176function invalidateRowCount(queryClient: ReturnType<typeof useQueryClient>, tableId: string) {
177 queryClient.invalidateQueries({ queryKey: tableKeys.rowsRoot(tableId) })

Callers 1

tableRowsInfiniteOptionsFunction · 0.85

Calls 1

requestJsonFunction · 0.90

Tested by

no test coverage detected