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

Function assertRowCapacity

apps/sim/lib/table/billing.ts:217–227  ·  view source on GitHub ↗
(params: {
  workspaceId: string
  currentRowCount: number
  addedRows: number
})

Source from the content-addressed store, hash-verified

215 * @throws {TableRowLimitError} if `currentRowCount + addedRows` exceeds the limit
216 */
217export async function assertRowCapacity(params: {
218 workspaceId: string
219 currentRowCount: number
220 addedRows: number
221}): Promise<number> {
222 const limit = await getMaxRowsPerTable(params.workspaceId)
223 if (wouldExceedRowLimit(limit, params.currentRowCount, params.addedRows)) {
224 throw new TableRowLimitError(limit)
225 }
226 return limit
227}
228
229/**
230 * Checks if a workspace can create more tables based on its plan limits.

Callers 8

flushFunction · 0.90
billing.test.tsFile · 0.90
createTableFunction · 0.90
importAppendRowsFunction · 0.90
importReplaceRowsFunction · 0.90
insertRowFunction · 0.90
batchInsertRowsFunction · 0.90
replaceTableRowsFunction · 0.90

Calls 2

getMaxRowsPerTableFunction · 0.85
wouldExceedRowLimitFunction · 0.85

Tested by

no test coverage detected