Home / Function/ projectSpecToMonthlyPrice() — supabase Function Reference

projectSpecToMonthlyPrice() — supabase Function Reference

Architecture documentation for the projectSpecToMonthlyPrice() function in RestoreToNewProject.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  8b340c8b_350d_ec99_3cc2_1dfe234b5e94["projectSpecToMonthlyPrice()"]
  b0f39a75_3ca4_89ba_15aa_05933a2676e4["getComputeHourlyPrice()"]
  8b340c8b_350d_ec99_3cc2_1dfe234b5e94 -->|calls| b0f39a75_3ca4_89ba_15aa_05933a2676e4
  style 8b340c8b_350d_ec99_3cc2_1dfe234b5e94 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/Database/Backups/RestoreToNewProject/RestoreToNewProject.utils.ts lines 23–56

export function projectSpecToMonthlyPrice({
  targetVolumeSizeGb,
  targetComputeSize,
  planId,
  storageType,
}: {
  targetVolumeSizeGb: number
  targetComputeSize: InfraInstanceSize
  planId: PlanId
  storageType: DiskType
}): NewProjectPrice {
  const diskPrice = calculateDiskSizePrice({
    planId,
    oldSize: 0,
    oldStorageType: storageType,
    newSize: targetVolumeSizeGb,
    newStorageType: storageType,
    numReplicas: 0,
  })

  const computePrice = calculateComputeSizePrice({
    availableOptions: [
      { identifier: targetComputeSize, price: getComputeHourlyPrice(targetComputeSize) },
    ],
    oldComputeSize: 'nano', // not used for r2np
    newComputeSize: targetComputeSize,
    plan: planId,
  })

  return {
    diskPrice: Number(diskPrice.newPrice) || 0,
    computePrice: Number(computePrice.newPrice) || 0,
  }
}

Subdomains

Frequently Asked Questions

What does projectSpecToMonthlyPrice() do?
projectSpecToMonthlyPrice() is a function in the supabase codebase.
What does projectSpecToMonthlyPrice() call?
projectSpecToMonthlyPrice() calls 1 function(s): getComputeHourlyPrice.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free