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

Function canCreateTable

apps/sim/lib/table/billing.ts:236–247  ·  view source on GitHub ↗

* Checks if a workspace can create more tables based on its plan limits. * * @param workspaceId - The workspace ID to check * @param currentTableCount - The current number of tables in the workspace * @returns Object with canCreate boolean and limit info

(
  workspaceId: string,
  currentTableCount: number
)

Source from the content-addressed store, hash-verified

234 * @returns Object with canCreate boolean and limit info
235 */
236async function canCreateTable(
237 workspaceId: string,
238 currentTableCount: number
239): Promise<{ canCreate: boolean; maxTables: number; currentCount: number }> {
240 const limits = await getWorkspaceTableLimits(workspaceId)
241
242 return {
243 canCreate: currentTableCount < limits.maxTables,
244 maxTables: limits.maxTables,
245 currentCount: currentTableCount,
246 }
247}
248
249/**
250 * Gets the maximum rows allowed per table for a workspace based on its plan.

Callers

nothing calls this directly

Calls 1

getWorkspaceTableLimitsFunction · 0.85

Tested by

no test coverage detected