Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Check if project is loading (#20497)

Terry Suttona652bae7d695
diff --git a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
index 882a1c562d2..db8c2f762f7 100644
--- a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
@@ -60,7 +60,7 @@ const FormSchema = z.object({
export const ConnectionPooling = () => {
const { ui } = useStore()
const { ref: projectRef } = useParams()
- const { project } = useProjectContext()
+ const { project, isLoading: projectIsLoading } = useProjectContext()
const { data: addons } = useProjectAddonsQuery({ projectRef })
const computeInstance = addons?.selected_addons.find((addon) => addon.type === 'compute_instance')
@@ -74,13 +74,15 @@ export const ConnectionPooling = () => {
} = usePoolingConfigurationQuery({ projectRef: projectRef })
const poolerTld = isSuccess ? getPoolerTld(poolingInfo.connectionString) : 'com'
+
const connectionPoolingUnavailable =
!poolingInfo?.pgbouncer_enabled && poolingInfo?.pool_mode === null
+
const poolerConnStringSyntax = isSuccess
? constructConnStringSyntax(poolingInfo?.connectionString, {
ref: projectRef as string,
- cloudProvider: project!.cloud_provider,
- region: project!.region,
+ cloudProvider: projectIsLoading ? '' : project?.cloud_provider || '',
+ region: projectIsLoading ? '' : project?.region || '',
tld: poolerTld,
portNumber: poolingInfo.db_port.toString(),
})
@@ -268,6 +270,7 @@ export const ConnectionPooling = () => {
<a
href="https://supabase.com/docs/guides/database/connecting-to-postgres#how-connection-pooling-works"
target="_blank"
+ rel="noreferrer"
className="underline"
>
documentation
@@ -319,6 +322,7 @@ export const ConnectionPooling = () => {
<a
href="https://supabase.com/docs/guides/platform/custom-postgres-config#pooler-config"
target="_blank"
+ rel="noreferrer"
className="underline"
>
documentation
@@ -386,6 +390,7 @@ export const ConnectionPooling = () => {
<a
href="https://supabase.com/docs/guides/platform/custom-postgres-config#pooler-config"
target="_blank"
+ rel="noreferrer"
className="underline"
>
documentation