The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Custom domains set refetch interval to false if 0_not_allowed (#34178)
Joshen Lim81cd4ae3b163
diff --git a/apps/studio/components/interfaces/Connect/ConnectTabContent.tsx b/apps/studio/components/interfaces/Connect/ConnectTabContent.tsxindex 123540e493a..90a45b233af 100644--- a/apps/studio/components/interfaces/Connect/ConnectTabContent.tsx+++ b/apps/studio/components/interfaces/Connect/ConnectTabContent.tsx@@ -44,10 +44,7 @@ const ConnectTabContent = forwardRef<HTMLDivElement, ConnectContentTabProps>(? getConnectionStringsV2({connectionInfo,poolingInfo: {- connectionString:- 'connection_string' in poolingConfiguration- ? poolingConfiguration.connection_string- : poolingConfiguration.connectionString,+ connectionString: poolingConfiguration.connection_string,db_host: poolingConfiguration.db_host,db_name: poolingConfiguration.db_name,db_port: poolingConfiguration.db_port,diff --git a/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx b/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsxindex c5581fb86e0..accea48929c 100644--- a/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx+++ b/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx@@ -135,10 +135,7 @@ export const DatabaseConnectionString = () => {? getConnectionStrings({connectionInfo,poolingInfo: {- connectionString:- 'connection_string' in poolingConfiguration- ? poolingConfiguration.connection_string- : poolingConfiguration.connectionString,+ connectionString: poolingConfiguration.connection_string,db_host: poolingConfiguration.db_host,db_name: poolingConfiguration.db_name,db_port: poolingConfiguration.db_port,diff --git a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsxindex 23837f4ffbd..165863f7aa6 100644--- a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx+++ b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx@@ -292,7 +292,13 @@ export const ConnectionPooling = () => {toast.success(`Successfully updated Supavisor configuration`)}setShowConfirmation(false)- form.reset({ type: 'Supavisor', ...data })+ if (data) {+ form.reset({+ type: 'Supavisor',+ pool_mode: data.pool_mode as 'transaction' | 'session',+ default_pool_size: data.default_pool_size,+ })+ }},})diff --git a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainConfig.tsx b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainConfig.tsxindex 9491f6c6d5d..32e666123b3 100644--- a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainConfig.tsx+++ b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainConfig.tsx@@ -5,9 +5,9 @@ import { useParams } from 'common'import { FormHeader } from 'components/ui/Forms/FormHeader'import Panel from 'components/ui/Panel'import UpgradeToPro from 'components/ui/UpgradeToPro'-import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query'import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'+import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'import { useFlag } from 'hooks/ui/useFlag'import CustomDomainActivate from './CustomDomainActivate'@@ -25,7 +25,8 @@ const CustomDomainConfig = () => {const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: organization?.slug })const plan = subscription?.plan?.id- const { isLoading: isSettingsLoading } = useProjectSettingsV2Query({ projectRef: ref })+ const { data: addons, isLoading: isLoadingAddons } = useProjectAddonsQuery({ projectRef: ref })+ const hasCustomDomainAddon = !!addons?.selected_addons.find((x) => x.type === 'custom_domain')const {isLoading: isCustomDomainsLoading,@@ -46,35 +47,16 @@ const CustomDomainConfig = () => {})- const isLoading = isSettingsLoading || isCustomDomainsLoading-return (<section id="custom-domains"><FormHeader title="Custom Domains" description="Present a branded experience to your users" />- {isLoading ? (+ {isLoadingAddons ? (<Panel><Panel.Content className="space-y-6"><CustomDomainsShimmerLoader /></Panel.Content></Panel>- ) : isError ? (- <Panel>- <Panel.Content className="space-y-6">- <div className="flex items-center justify-center space-x-2 py-8">- <AlertCircle size={16} strokeWidth={1.5} />- <p className="text-sm text-foreground-light">- Failed to retrieve custom domain configuration. Please try again later or{' '}- <Link href={`/support/new?ref=${ref}&category=sales`} className="underline">- contact support- </Link>- .- </p>- </div>- </Panel.Content>- </Panel>- ) : data?.status === '0_no_hostname_configured' ? (- <CustomDomainsConfigureHostname />- ) : data?.status === '0_not_allowed' ? (+ ) : !hasCustomDomainAddon ? (<UpgradeToProicon={<AlertCircle size={18} strokeWidth={1.5} />}primaryText={@@ -93,6 +75,29 @@ const CustomDomainConfig = () => {source="customDomain"disabled={customDomainsDisabledDueToQuota}/>+ ) : isCustomDomainsLoading ? (+ <Panel>+ <Panel.Content className="space-y-6">+ <CustomDomainsShimmerLoader />+ </Panel.Content>+ </Panel>+ ) : isError ? (+ <Panel>+ <Panel.Content className="space-y-6">+ <div className="flex items-center justify-center space-x-2 py-8">+ <AlertCircle size={16} strokeWidth={1.5} />+ <p className="text-sm text-foreground-light">+ Failed to retrieve custom domain configuration. Please try again later or{' '}+ <Link href={`/support/new?ref=${ref}&category=sales`} className="underline">+ contact support+ </Link>+ .+ </p>+ </div>+ </Panel.Content>+ </Panel>+ ) : data?.status === '0_no_hostname_configured' ? (+ <CustomDomainsConfigureHostname />) : (<Panel>{isSuccess && (diff --git a/apps/studio/data/custom-domains/custom-domains-query.ts b/apps/studio/data/custom-domains/custom-domains-query.tsindex f4ab2ee06fc..8c8488c4685 100644--- a/apps/studio/data/custom-domains/custom-domains-query.ts+++ b/apps/studio/data/custom-domains/custom-domains-query.ts@@ -1,6 +1,7 @@import { useQuery, UseQueryOptions } from '@tanstack/react-query'import { get, handleError } from 'data/fetchers'+import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'import { IS_PLATFORM } from 'lib/constants'import type { ResponseError } from 'types'import { customDomainKeys } from './keys'@@ -105,9 +106,16 @@ export type CustomDomainsError = ResponseErrorexport const useCustomDomainsQuery = <TData = CustomDomainsData>({ projectRef }: CustomDomainsVariables,{ enabled = true, ...options }: UseQueryOptions<CustomDomainsData, CustomDomainsError, TData> = {}-) =>- useQuery<CustomDomainsData, CustomDomainsError, TData>(+) => {+ const { data } = useProjectAddonsQuery({ projectRef })+ const hasCustomDomainsAddon = !!data?.selected_addons.find((x) => x.type === 'custom_domain')++ return useQuery<CustomDomainsData, CustomDomainsError, TData>(customDomainKeys.list(projectRef),({ signal }) => getCustomDomains({ projectRef }, signal),- { enabled: enabled && IS_PLATFORM && typeof projectRef !== 'undefined', ...options }+ {+ enabled: enabled && IS_PLATFORM && typeof projectRef !== 'undefined' && hasCustomDomainsAddon,+ ...options,+ })+}diff --git a/packages/api-types/types/api.d.ts b/packages/api-types/types/api.d.tsindex 72d4c686f43..6f9ab1e3159 100644--- a/packages/api-types/types/api.d.ts+++ b/packages/api-types/types/api.d.ts@@ -271,6 +271,41 @@ export interface paths {patch: operations['updateApiKey']trace?: never}+ '/v1/projects/{ref}/billing/addons': {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ /** Lists project addons */+ get: operations['v1-list-project-addons']+ put?: never+ post?: never+ delete?: never+ options?: never+ head?: never+ /** Applies project addon */+ patch: operations['v1-apply-project-addon']+ trace?: never+ }+ '/v1/projects/{ref}/billing/addons/{addon_variant}': {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ get?: never+ put?: never+ post?: never+ /** Removes project addon */+ delete: operations['v1-remove-project-addon']+ options?: never+ head?: never+ patch?: never+ trace?: never+ }'/v1/projects/{ref}/branches': {parameters: {query?: never@@ -1237,6 +1272,33 @@ export interface components {ApiKeySecretJWTTemplate: {role: string}+ ApplyProjectAddonBodyDto: {+ /** @enum {string} */+ addon_type:+ | 'custom_domain'+ | 'compute_instance'+ | 'pitr'+ | 'ipv4'+ | 'auth_mfa_phone'+ | 'auth_mfa_web_authn'+ | 'log_drain'+ addon_variant:+ | (+ | 'ci_micro'+ | 'ci_small'+ | 'ci_medium'+ | 'ci_large'+ | 'ci_xlarge'+ | 'ci_2xlarge'+ | 'ci_4xlarge'+ | 'ci_8xlarge'+ | 'ci_12xlarge'+ | 'ci_16xlarge'+ )+ | 'cd_default'+ | ('pitr_7' | 'pitr_14' | 'pitr_28')+ | 'ipv4_default'+ }AttributeMapping: {keys: {[key: string]: components['schemas']['AttributeValue']@@ -1714,6 +1776,97 @@ export interface components {saml?: components['schemas']['SamlDescriptor']updated_at?: string}+ ListProjectAddonsResponseDto: {+ available_addons: {+ name: string+ /** @enum {string} */+ type:+ | 'custom_domain'+ | 'compute_instance'+ | 'pitr'+ | 'ipv4'+ | 'auth_mfa_phone'+ | 'auth_mfa_web_authn'+ | 'log_drain'+ variants: {+ id:+ | (+ | 'ci_micro'+ | 'ci_small'+ | 'ci_medium'+ | 'ci_large'+ | 'ci_xlarge'+ | 'ci_2xlarge'+ | 'ci_4xlarge'+ | 'ci_8xlarge'+ | 'ci_12xlarge'+ | 'ci_16xlarge'+ )+ | 'cd_default'+ | ('pitr_7' | 'pitr_14' | 'pitr_28')+ | 'ipv4_default'+ | 'auth_mfa_phone_default'+ | 'auth_mfa_web_authn_default'+ | 'log_drain_default'+ meta?: {+ [key: string]: number | boolean | string | string[]+ }+ name: string+ price: {+ amount: number+ description: string+ /** @enum {string} */+ interval: 'monthly' | 'hourly'+ /** @enum {string} */+ type: 'fixed' | 'usage'+ }+ }[]+ }[]+ selected_addons: {+ /** @enum {string} */+ type:+ | 'custom_domain'+ | 'compute_instance'+ | 'pitr'+ | 'ipv4'+ | 'auth_mfa_phone'+ | 'auth_mfa_web_authn'+ | 'log_drain'+ variant: {+ id:+ | (+ | 'ci_micro'+ | 'ci_small'+ | 'ci_medium'+ | 'ci_large'+ | 'ci_xlarge'+ | 'ci_2xlarge'+ | 'ci_4xlarge'+ | 'ci_8xlarge'+ | 'ci_12xlarge'+ | 'ci_16xlarge'+ )+ | 'cd_default'+ | ('pitr_7' | 'pitr_14' | 'pitr_28')+ | 'ipv4_default'+ | 'auth_mfa_phone_default'+ | 'auth_mfa_web_authn_default'+ | 'log_drain_default'+ meta?: {+ [key: string]: number | boolean | string | string[]+ }+ name: string+ price: {+ amount: number+ description: string+ /** @enum {string} */+ interval: 'monthly' | 'hourly'+ /** @enum {string} */+ type: 'fixed' | 'usage'+ }+ }+ }[]+ }ListProvidersResponse: {items: components['schemas']['Provider'][]}@@ -2005,6 +2158,7 @@ export interface components {available: boolean}SupavisorConfigResponse: {+ connection_string: stringconnectionString: string/** @enum {string} */database_type: 'PRIMARY' | 'READ_REPLICA'@@ -2306,16 +2460,14 @@ export interface components {UpdateSupavisorConfigBody: {default_pool_size?: number | null/**- * @deprecated- * @description This field is deprecated and is ignored in this request+ * @description Dedicated pooler mode for the project* @enum {string}*/pool_mode?: 'transaction' | 'session'}UpdateSupavisorConfigResponse: {default_pool_size: number | null- /** @enum {string} */- pool_mode: 'transaction' | 'session'+ pool_mode: string}UpgradeDatabaseBody: {release_channel: components['schemas']['ReleaseChannel']@@ -3178,6 +3330,124 @@ export interface operations {}}}+ 'v1-list-project-addons': {+ parameters: {+ query?: never+ header?: never+ path: {+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content: {+ 'application/json': components['schemas']['ListProjectAddonsResponseDto']+ }+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ /** @description Failed to list project addons */+ 500: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ 'v1-apply-project-addon': {+ parameters: {+ query?: never+ header?: never+ path: {+ ref: string+ }+ cookie?: never+ }+ requestBody: {+ content: {+ 'application/json': components['schemas']['ApplyProjectAddonBodyDto']+ }+ }+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ /** @description Failed to apply project addon */+ 500: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ 'v1-remove-project-addon': {+ parameters: {+ query?: never+ header?: never+ path: {+ addon_variant:+ | 'ci_micro'+ | 'ci_small'+ | 'ci_medium'+ | 'ci_large'+ | 'ci_xlarge'+ | 'ci_2xlarge'+ | 'ci_4xlarge'+ | 'ci_8xlarge'+ | 'ci_12xlarge'+ | 'ci_16xlarge'+ | 'cd_default'+ | 'pitr_7'+ | 'pitr_14'+ | 'pitr_28'+ | 'ipv4_default'+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ 403: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ /** @description Failed to remove project addon */+ 500: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }'v1-list-all-branches': {parameters: {query?: neverdiff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.tsindex 626079ca3ae..61261b68df0 100644--- a/packages/api-types/types/platform.d.ts+++ b/packages/api-types/types/platform.d.ts@@ -2746,6 +2746,25 @@ export interface paths {patch?: nevertrace?: never}+ '/platform/projects/{ref}/notifications/advisor/exceptions': {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ /** List advisor notification exceptions */+ get: operations['ProjectAdvisorNotificationsController_listNotificationExceptions']+ put?: never+ /** Create advisor notification exceptions */+ post: operations['ProjectAdvisorNotificationsController_createNotificationExceptions']+ /** Deletes advisor notification exceptions */+ delete: operations['ProjectAdvisorNotificationsController_deleteNotificationExceptions']+ options?: never+ head?: never+ patch?: never+ trace?: never+ }'/platform/projects/{ref}/pause': {parameters: {query?: never@@ -3802,6 +3821,23 @@ export interface paths {patch?: nevertrace?: never}+ '/platform/update-email': {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ get?: never+ /** Updates a user email address */+ put: operations['UpdateEmailController_updateEmail']+ post?: never+ delete?: never+ options?: never+ head?: never+ patch?: never+ trace?: never+ }'/platform/vercel/projects': {parameters: {query?: never@@ -4252,6 +4288,56 @@ export interface components {role_id: numberrole_scoped_projects?: string[]}+ CreateNotificationExceptionsDto: {+ exceptions: {+ /** Format: uuid */+ assigned_to?: string+ is_disabled: boolean+ /** @enum {string} */+ lint_category?: 'ALL' | 'PERFORMANCE' | 'SECURITY'+ /** @enum {string} */+ lint_name?:+ | 'ssl_not_enforced'+ | 'network_restrictions_not_set'+ | 'pitr_not_enabled'+ | 'password_requirements_min_length'+ | 'unindexed_foreign_keys'+ | 'auth_users_exposed'+ | 'auth_rls_initplan'+ | 'no_primary_key'+ | 'unused_index'+ | 'multiple_permissive_policies'+ | 'policy_exists_rls_disabled'+ | 'rls_enabled_no_policy'+ | 'duplicate_index'+ | 'security_definer_view'+ | 'function_search_path_mutable'+ | 'rls_disabled_in_public'+ | 'extension_in_public'+ | 'rls_references_user_metadata'+ | 'materialized_view_in_api'+ | 'foreign_table_in_api'+ | 'unsupported_reg_types'+ note?: string+ }[]+ }+ CreateNotificationExceptionsResponseDto: {+ exceptions: {+ /** Format: uuid */+ assigned_to: string | null+ /** Format: uuid */+ id: string+ /** Format: date-time */+ inserted_at: string+ is_disabled: boolean+ /** Format: uuid */+ last_updated_by: string+ lint_category: string | null+ lint_name: string | null+ note: string | null+ project_id: number+ }[]+ }CreateOAuthAppBody: {icon?: stringname: string@@ -4388,6 +4474,8 @@ export interface components {CreateReplicationSinkBody: {/** @description BigQuery dataset id */dataset_id: string+ /** @description Max staleness in minutes */+ max_staleness_mins: number/** @description BigQuery project id */project_id: string/** @description BigQuery service account key */@@ -5378,6 +5466,23 @@ export interface components {primary_email: string | nullusername: string}+ ListNotificationExceptionsResponseDto: {+ exceptions: {+ /** Format: uuid */+ assigned_to: string | null+ /** Format: uuid */+ id: string+ /** Format: date-time */+ inserted_at: string+ is_disabled: boolean+ /** Format: uuid */+ last_updated_by: string+ lint_category: string | null+ lint_name: string | null+ note: string | null+ project_id: number+ }[]+ }LoadBalancerDatabase: {identifier: stringstatus: string@@ -5454,10 +5559,12 @@ export interface components {unread_count: number}OAuthAppResponse: {+ app_id?: stringauthorized_at?: stringclient_id?: stringclient_secret_alias?: stringcreated_at?: string+ created_by?: stringicon?: stringid: stringname: string@@ -5561,8 +5668,7 @@ export interface components {opt_in_tags: string[]projects: components['schemas']['OrganizationSlugProject'][]restriction_data: Record<string, never> | null- /** @enum {string|null} */- restriction_status: 'grace_period' | 'grace_period_over' | 'restricted' | null+ restriction_status: Record<string, never> | nullslug: string}OrgDocumentUrlResponse: {@@ -6277,6 +6383,7 @@ export interface components {config: {big_query: {dataset_id: string+ max_staleness_mins: numberproject_id: stringservice_account_key: string}@@ -6290,6 +6397,7 @@ export interface components {config: {big_query: {dataset_id: string+ max_staleness_mins: numberproject_id: stringservice_account_key: string}@@ -6544,6 +6652,7 @@ export interface components {width?: number}SupavisorConfigResponse: {+ connection_string: stringconnectionString: string/** @enum {string} */database_type: 'PRIMARY' | 'READ_REPLICA'@@ -6730,6 +6839,9 @@ export interface components {*/min_increment_gb?: number}+ UpdateEmailBodyDto: {+ newEmail: string+ }UpdateFunctionBody: {args?: string[]/** @enum {string} */@@ -7085,6 +7197,8 @@ export interface components {UpdateReplicationSinkBody: {/** @description BigQuery dataset id */dataset_id: string+ /** @description Max staleness in minutes */+ max_staleness_mins: number/** @description BigQuery project id */project_id: string/** @description BigQuery service account key */@@ -7121,16 +7235,14 @@ export interface components {UpdateSupavisorConfigBody: {default_pool_size?: number | null/**- * @deprecated- * @description This field is deprecated and is ignored in this request+ * @description Dedicated pooler mode for the project* @enum {string}*/pool_mode?: 'transaction' | 'session'}UpdateSupavisorConfigResponse: {default_pool_size: number | null- /** @enum {string} */- pool_mode: 'transaction' | 'session'+ pool_mode: string}UpdateTableBody: {comment?: string@@ -14944,6 +15056,7 @@ export interface operations {| 'total_storage_delete_requests'| 'total_storage_options_requests'| 'total_storage_patch_requests'+ | 'total_logdrain_egress'endDate: stringinterval: stringstartDate: string@@ -15344,6 +15457,94 @@ export interface operations {}}}+ ProjectAdvisorNotificationsController_listNotificationExceptions: {+ parameters: {+ query?: never+ header?: never+ path: {+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content: {+ 'application/json': components['schemas']['ListNotificationExceptionsResponseDto']+ }+ }+ /** @description Failed to retrieve advisor notification exceptions */+ 500: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ ProjectAdvisorNotificationsController_createNotificationExceptions: {+ parameters: {+ query?: never+ header?: never+ path: {+ ref: string+ }+ cookie?: never+ }+ requestBody: {+ content: {+ 'application/json': components['schemas']['CreateNotificationExceptionsDto']+ }+ }+ responses: {+ 201: {+ headers: {+ [name: string]: unknown+ }+ content: {+ 'application/json': components['schemas']['CreateNotificationExceptionsResponseDto']+ }+ }+ /** @description Failed to creare advisor notification exceptions */+ 500: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }+ ProjectAdvisorNotificationsController_deleteNotificationExceptions: {+ parameters: {+ query: {+ ids: string[]+ }+ header?: never+ path: {+ ref: string+ }+ cookie?: never+ }+ requestBody?: never+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ /** @description Failed to delete advisor notification exceptions */+ 500: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }PauseController_pauseProject: {parameters: {query?: never@@ -17750,6 +17951,27 @@ export interface operations {}}}+ UpdateEmailController_updateEmail: {+ parameters: {+ query?: never+ header?: never+ path?: never+ cookie?: never+ }+ requestBody: {+ content: {+ 'application/json': components['schemas']['UpdateEmailBodyDto']+ }+ }+ responses: {+ 200: {+ headers: {+ [name: string]: unknown+ }+ content?: never+ }+ }+ }VercelProjectsController_getVercelProjects: {parameters: {query: {