(params: {
workspaceId: string
currentRowCount: number
addedRows: number
})
| 215 | * @throws {TableRowLimitError} if `currentRowCount + addedRows` exceeds the limit |
| 216 | */ |
| 217 | export 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. |
no test coverage detected