diff --git a/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx b/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx index 5f3ea463615..c5581fb86e0 100644 --- a/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx +++ b/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx @@ -377,7 +377,7 @@ export const DatabaseConnectionString = () => { ]} onCopyCallback={() => handleCopy(selectedTab, 'transaction_pooler')} /> - {ipv4Addon && ( + {ipv4Addon && !isPgBouncerEnabled && ( { { ref: projectRef, default_pool_size, - pool_mode: pool_mode as 'transaction' | 'session', }, { onSuccess: (data) => { @@ -524,100 +523,102 @@ export const ConnectionPooling = () => { /> )} - ( - - {disablePoolModeSelection && ( - - - Pool mode is permanently set to Transaction on port 6543 - - - You can use Session mode by connecting to the pooler on port 5432 - instead - - - )} - {showPoolModeWarning && ( - <> - {field.value === 'transaction' ? ( - - ) : ( - <> - + {type === 'PgBouncer' && ( + ( + + {disablePoolModeSelection && ( + + + Pool mode is permanently set to Transaction on port 6543 + + + You can use Session mode by connecting to the pooler on port + 5432 instead + + + )} + {showPoolModeWarning && ( + <> + {field.value === 'transaction' ? ( + ) : ( + <> + + - - )} - - )} -

- Specify when a connection can be returned to the pool.{' '} - snap.setShowPoolingModeHelper(true)} - className="transition cursor-pointer underline underline-offset-2 decoration-foreground-lighter hover:decoration-foreground text-foreground" - > - Learn more about pool modes - - . -

- - } - > - - field.onChange(value)} - > - + + )} + + )} +

+ Specify when a connection can be returned to the pool.{' '} + snap.setShowPoolingModeHelper(true)} + className="transition cursor-pointer underline underline-offset-2 decoration-foreground-lighter hover:decoration-foreground text-foreground" + > + Learn more about pool modes + + . +

+ + } + > + + field.onChange(value)} > -

Transaction mode

-

- {TRANSACTION_MODE_DESCRIPTION} -

-
- -

Session mode

-

- {SESSION_MODE_DESCRIPTION} -

-
-
-
-
- )} - /> + +

Transaction mode

+

+ {TRANSACTION_MODE_DESCRIPTION} +

+
+ +

Session mode

+

+ {SESSION_MODE_DESCRIPTION} +

+
+ + +
+ )} + /> + )}