mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 15:19:08 +03:00
tidy
This commit is contained in:
1 parent
b7cefaa1de
commit
ba0a6ff2ae
2 files changed
-91
No files matched your search
@@ -1,82 +0,0 @@
|
||||
import { ExternalLink } from 'lucide-react'
|
||||
|
||||
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
|
||||
import { WarningIcon } from 'ui'
|
||||
|
||||
export const IPv4DeprecationNotice = () => {
|
||||
return (
|
||||
<Alert_Shadcn_ variant="warning">
|
||||
<WarningIcon />
|
||||
<AlertTitle_Shadcn_>
|
||||
Direct database access is only available via IPv6-compatible networks.
|
||||
</AlertTitle_Shadcn_>
|
||||
<AlertDescription_Shadcn_ className="space-y-3">
|
||||
<p>
|
||||
We strongly recommend using connection pooling to connect to your database because it's
|
||||
compatible with both IPv4 and IPv6 networks. You'll only need to change the connection
|
||||
credentials that you're using in your application to the pooler's connection credentials.
|
||||
</p>
|
||||
<Button asChild type="default" icon={<ExternalLink />}>
|
||||
<a
|
||||
href="https://github.com/orgs/supabase/discussions/17817"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Learn more
|
||||
</a>
|
||||
</Button>
|
||||
</AlertDescription_Shadcn_>
|
||||
</Alert_Shadcn_>
|
||||
)
|
||||
}
|
||||
|
||||
export const IPv4AddonDirectConnectionNotice = () => {
|
||||
return (
|
||||
<Alert_Shadcn_ variant="default">
|
||||
<AlertTitle_Shadcn_>
|
||||
Direct database connections are recommended if you're connecting with session mode.
|
||||
</AlertTitle_Shadcn_>
|
||||
<AlertDescription_Shadcn_ className="space-y-3">
|
||||
<p>
|
||||
If you are not connecting to the database from serverless environments, we strongly
|
||||
recommend you connect to the database directly instead of using connection pooling for
|
||||
lower latency.
|
||||
</p>
|
||||
<p>
|
||||
Since your project has the IPv4 add on, you are not required to use the connection pooler
|
||||
even if your network only supports IPv4.
|
||||
</p>
|
||||
<Button asChild type="default" icon={<ExternalLink />}>
|
||||
<a
|
||||
href="https://supabase.com/docs/guides/database/connecting-to-postgres#connection-pooler"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Learn more
|
||||
</a>
|
||||
</Button>
|
||||
</AlertDescription_Shadcn_>
|
||||
</Alert_Shadcn_>
|
||||
)
|
||||
}
|
||||
|
||||
export const DefaultSessionModeNotice = () => {
|
||||
return (
|
||||
<Alert_Shadcn_ variant="warning">
|
||||
<WarningIcon />
|
||||
<AlertTitle_Shadcn_>You are not yet in Transaction mode.</AlertTitle_Shadcn_>
|
||||
<AlertDescription_Shadcn_ className="space-y-3">
|
||||
<p>
|
||||
You need to set your <span className="text-foreground">Pool Mode</span> to{' '}
|
||||
<span className="text-foreground">Transaction</span> in the{' '}
|
||||
<span className="text-foreground">Connection pooling configuration</span> section below in
|
||||
order to use transaction mode on port 6543.
|
||||
</p>
|
||||
<p>
|
||||
Otherwise, port 6543 will continue to connect in{' '}
|
||||
<span className="text-foreground">Session</span> mode.
|
||||
</p>
|
||||
</AlertDescription_Shadcn_>
|
||||
</Alert_Shadcn_>
|
||||
)
|
||||
}
|
||||
@@ -3,8 +3,6 @@ import { useEffect, useRef, useState } from 'react'
|
||||
import { useParams } from 'common'
|
||||
import { getAddons } from 'components/interfaces/Billing/Subscription/Subscription.utils'
|
||||
import AlertError from 'components/ui/AlertError'
|
||||
import DatabaseSelector from 'components/ui/DatabaseSelector'
|
||||
import Panel from 'components/ui/Panel'
|
||||
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
|
||||
import { usePoolingConfigurationQuery } from 'data/database/pooling-configuration-query'
|
||||
import { useReadReplicasQuery } from 'data/read-replicas/replicas-query'
|
||||
@@ -13,13 +11,6 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
|
||||
import { pluckObjectFields } from 'lib/helpers'
|
||||
import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'
|
||||
import { useDatabaseSettingsStateSnapshot } from 'state/database-settings'
|
||||
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Input, WarningIcon } from 'ui'
|
||||
import {
|
||||
DefaultSessionModeNotice,
|
||||
IPv4AddonDirectConnectionNotice,
|
||||
IPv4DeprecationNotice,
|
||||
} from './DatabaseConnectionNotices'
|
||||
import { UsePoolerCheckbox } from './UsePoolerCheckbox'
|
||||
|
||||
const DatabaseSettings = () => {
|
||||
const { ref: projectRef, connectionString } = useParams()
|
||||
|
||||
Reference in new issue
Block a user