Skip to content

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

Add restrictions for orioledb technical preview (#30410)

Joshen Lima4243f438f9d
diff --git a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
index 53b5e0b957b..3acf2500059 100644
--- a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
+++ b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx
@@ -19,6 +19,11 @@ import {
Modal,
WarningIcon,
} from 'ui'
+import { Admonition } from 'ui-patterns'
+import { DocsButton } from 'components/ui/DocsButton'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
+
+const orioleExtCallOuts = ['vector', 'postgis']
interface EnableExtensionModalProps {
visible: boolean
@@ -28,6 +33,7 @@ interface EnableExtensionModalProps {
const EnableExtensionModal = ({ visible, extension, onCancel }: EnableExtensionModalProps) => {
const { project } = useProjectContext()
+ const isOrioleDb = useIsOrioleDb()
const [defaultSchema, setDefaultSchema] = useState()
const [fetchingSchemaInfo, setFetchingSchemaInfo] = useState(false)
@@ -129,7 +135,17 @@ const EnableExtensionModal = ({ visible, extension, onCancel }: EnableExtensionM
{({ values }: any) => {
return (
<>
- <Modal.Content>
+ <Modal.Content className="flex flex-col gap-y-2">
+ {isOrioleDb && orioleExtCallOuts.includes(extension.name) && (
+ <Admonition type="default" title="Extension is limited by OrioleDB">
+ <span className="block">
+ {extension.name} cannot be accelerated by indexes on tables that are using the
+ OrioleDB access method
+ </span>
+ <DocsButton abbrev={false} className="mt-2" href="https://supabase.com/docs" />
+ </Admonition>
+ )}
+
{fetchingSchemaInfo || isSchemasLoading ? (
<div className="space-y-2">
<ShimmeringLoader />
diff --git a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
index 04ee9e29162..4b922043dba 100644
--- a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
+++ b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx
@@ -37,6 +37,9 @@ import { MultiSelectOption } from 'ui-patterns/MultiSelectDeprecated'
import { MultiSelectV2 } from 'ui-patterns/MultiSelectDeprecated/MultiSelectV2'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { INDEX_TYPES } from './Indexes.constants'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
+import { Admonition } from 'ui-patterns'
+import { DocsButton } from 'components/ui/DocsButton'
interface CreateIndexSidePanelProps {
visible: boolean
@@ -46,6 +49,8 @@ interface CreateIndexSidePanelProps {
const CreateIndexSidePanel = ({ visible, onClose }: CreateIndexSidePanelProps) => {
const queryClient = useQueryClient()
const { project } = useProjectContext()
+ const isOrioleDb = useIsOrioleDb()
+
const [selectedSchema, setSelectedSchema] = useState('public')
const [selectedEntity, setSelectedEntity] = useState<string | undefined>(undefined)
const [selectedColumns, setSelectedColumns] = useState<string[]>([])
@@ -336,6 +341,7 @@ CREATE INDEX ON "${selectedSchema}"."${selectedEntity}" USING ${selectedIndexTyp
isReactForm={false}
>
<Select_Shadcn_
+ disabled={isOrioleDb}
value={selectedIndexType}
onValueChange={setSelectedIndexType}
name="selected-index-type"
@@ -367,6 +373,17 @@ CREATE INDEX ON "${selectedSchema}"."${selectedEntity}" USING ${selectedIndexTyp
</SelectContent_Shadcn_>
</Select_Shadcn_>
</FormItemLayout>
+ {isOrioleDb && (
+ <Admonition
+ type="default"
+ className="!mt-2"
+ title="OrioleDB currently only supports the B-tree index type"
+ description="More index types may be supported when OrioleDB is no longer in preview"
+ >
+ {/* [Joshen Oriole] Hook up proper docs URL */}
+ <DocsButton className="mt-2" abbrev={false} href="https://supabase.com/docs" />
+ </Admonition>
+ )}
</SidePanel.Content>
<SidePanel.Separator />
<SidePanel.Content>
diff --git a/apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx b/apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx
index 1c001ad2d9d..24c0638a1eb 100644
--- a/apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx
+++ b/apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx
@@ -135,7 +135,7 @@ export function ComputeSizeField({ form, disabled }: ComputeSizeFieldProps) {
free={showUpgradeBadge && form.watch('computeSize') === 'ci_micro' ? true : false}
/>
<p className="text-foreground-lighter">
- Hardware resources allocated to your postgres database
+ Hardware resources allocated to your Postgres database
</p>
<NoticeBar
showIcon={false}
diff --git a/apps/studio/components/interfaces/DiskManagement/fields/IOPSField.tsx b/apps/studio/components/interfaces/DiskManagement/fields/IOPSField.tsx
index 69d369dd9a1..db4e473cb28 100644
--- a/apps/studio/components/interfaces/DiskManagement/fields/IOPSField.tsx
+++ b/apps/studio/components/interfaces/DiskManagement/fields/IOPSField.tsx
@@ -15,7 +15,6 @@ import { BillingChangeBadge } from '../ui/BillingChangeBadge'
import { ComputeSizeRecommendationSection } from '../ui/ComputeSizeRecommendationSection'
import {
COMPUTE_BASELINE_IOPS,
- DISK_LIMITS,
DiskType,
RESTRICTED_COMPUTE_FOR_IOPS_ON_GP3,
} from '../ui/DiskManagement.constants'
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
index 76f834a19be..138d6b36f14 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
@@ -16,6 +16,7 @@ import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import { useFreeProjectLimitCheckQuery } from 'data/organizations/free-project-limit-check-query'
import { organizationKeys } from 'data/organizations/keys'
import { useOrganizationBillingSubscriptionPreview } from 'data/organizations/organization-billing-subscription-preview'
+import { useOrganizationQuery } from 'data/organizations/organization-query'
import { useProjectsQuery } from 'data/projects/projects-query'
import { useOrgPlansQuery } from 'data/subscriptions/org-plans-query'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
@@ -23,6 +24,7 @@ import { useOrgSubscriptionUpdateMutation } from 'data/subscriptions/org-subscri
import type { OrgPlan, SubscriptionTier } from 'data/subscriptions/types'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
+import { useFlag } from 'hooks/ui/useFlag'
import { PRICING_TIER_PRODUCT_IDS } from 'lib/constants'
import { formatCurrency } from 'lib/helpers'
import { pickFeatures, pickFooter, plans as subscriptionsPlans } from 'shared-data/plans'
@@ -41,8 +43,8 @@ const PlanUpdateSidePanel = () => {
const slug = selectedOrganization?.slug
const queryClient = useQueryClient()
-
const originalPlanRef = useRef<string>()
+ const allowOrioleDB = useFlag('allowOrioleDB')
const [showExitSurvey, setShowExitSurvey] = useState(false)
const [showUpgradeSurvey, setShowUpgradeSurvey] = useState(false)
@@ -60,6 +62,9 @@ const PlanUpdateSidePanel = () => {
(it) => it.organization_id === selectedOrganization?.id
)
+ const { data } = useOrganizationQuery({ slug }, { enabled: allowOrioleDB })
+ const hasOrioleProjects = allowOrioleDB ? false : !!data?.has_oriole_project
+
const snap = useOrgSettingsPageStateSnapshot()
const visible = snap.panelKey === 'subscriptionPlan'
const onClose = () => {
@@ -181,10 +186,10 @@ const PlanUpdateSidePanel = () => {
header={
<div className="flex items-center justify-between">
<h4>Change subscription plan for {selectedOrganization?.name}</h4>
- <Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />}>
- <Link href="https://supabase.com/pricing" target="_blank" rel="noreferrer">
+ <Button asChild type="default" icon={<ExternalLink />}>
+ <a href="https://supabase.com/pricing" target="_blank" rel="noreferrer">
Pricing
- </Link>
+ </a>
</Button>
</div>
}
@@ -213,13 +218,14 @@ const PlanUpdateSidePanel = () => {
return (
<div
key={plan.id}
- className={
- 'border rounded-md px-4 py-4 flex flex-col items-start justify-between col-span-12 md:col-span-4 bg-surface-200'
- }
+ className={cn(
+ 'px-4 py-4 flex flex-col items-start justify-between',
+ 'border rounded-md col-span-12 md:col-span-4 bg-surface-200'
+ )}
>
<div className="w-full">
<div className="flex items-center space-x-2">
- <p className={cn('text-brand text-sm uppercase')}>{plan.name}</p>
+ <p className="text-brand text-sm uppercase">{plan.name}</p>
{isCurrentPlan ? (
<div className="text-xs bg-surface-300 text-foreground-light rounded px-2 py-0.5">
Current plan
@@ -228,9 +234,7 @@ const PlanUpdateSidePanel = () => {
<div className="text-xs bg-brand-400 text-brand-600 rounded px-2 py-0.5">
{plan.nameBadge}
</div>
- ) : (
- <></>
- )}
+ ) : null}
</div>
<div className="mt-4 flex items-center space-x-1 mb-4">
{(price ?? 0) > 0 && <p className="text-foreground-light text-sm">From</p>}
@@ -251,17 +255,24 @@ const PlanUpdateSidePanel = () => {
<ButtonTooltip
block
type={isDowngradeOption ? 'default' : 'primary'}
- disabled={subscription?.plan?.id === 'enterprise' || !canUpdateSubscription}
+ disabled={
+ subscription?.plan?.id === 'enterprise' ||
+ hasOrioleProjects ||
+ !canUpdateSubscription
+ }
onClick={() => setSelectedTier(plan.id as any)}
tooltip={{
content: {
side: 'bottom',
+ className: hasOrioleProjects ? 'w-96 text-center' : '',
text:
subscription?.plan?.id === 'enterprise'
? 'Reach out to us via support to update your plan from Enterprise'
- : !canUpdateSubscription
- ? 'You do not have permission to change the subscription plan'
- : undefined,
+ : hasOrioleProjects
+ ? 'Your organization has projects that are using the OrioleDB extension which is only available on the Free plan. Remove all OrioleDB projects before changing your plan.'
+ : !canUpdateSubscription
+ ? 'You do not have permission to change the subscription plan'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx b/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx
new file mode 100644
index 00000000000..60a0a5d0d33
--- /dev/null
+++ b/apps/studio/components/interfaces/ProjectCreation/AdvancedConfiguration.tsx
@@ -0,0 +1,126 @@
+import { ChevronRight } from 'lucide-react'
+import { UseFormReturn } from 'react-hook-form'
+
+import Panel from 'components/ui/Panel'
+import { CreateProjectForm } from 'pages/new/[slug]'
+import {
+ Badge,
+ cn,
+ Collapsible_Shadcn_,
+ CollapsibleContent_Shadcn_,
+ CollapsibleTrigger_Shadcn_,
+ FormControl_Shadcn_,
+ FormField_Shadcn_,
+ FormItem_Shadcn_,
+ RadioGroupStacked,
+ RadioGroupStackedItem,
+} from 'ui'
+import { Admonition } from 'ui-patterns'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
+import { DocsButton } from 'components/ui/DocsButton'
+
+interface AdvancedConfigurationProps {
+ form: UseFormReturn<CreateProjectForm>
+}
+
+export const AdvancedConfiguration = ({ form }: AdvancedConfigurationProps) => {
+ return (
+ <Panel.Content>
+ <Collapsible_Shadcn_>
+ <CollapsibleTrigger_Shadcn_ className="group/advanced-trigger font-mono uppercase tracking-widest text-xs flex items-center gap-1 text-foreground-lighter/75 hover:text-foreground-light transition data-[state=open]:text-foreground-light">
+ Advanced Configuration
+ <ChevronRight
+ size={16}
+ strokeWidth={1}
+ className="mr-2 group-data-[state=open]/advanced-trigger:rotate-90 group-hover/advanced-trigger:text-foreground-light transition"
+ />
+ </CollapsibleTrigger_Shadcn_>
+ <CollapsibleContent_Shadcn_
+ className={cn(
+ 'pt-5 data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down'
+ )}
+ >
+ <FormField_Shadcn_
+ name="useOrioleDb"
+ control={form.control}
+ render={({ field }) => (
+ <>
+ <FormItemLayout
+ layout="horizontal"
+ label="Postgres Type"
+ className="[&>div>label]:!break-normal"
+ >
+ <FormControl_Shadcn_>
+ <RadioGroupStacked
+ // Due to radio group not supporting boolean values
+ // value is converted to boolean
+ onValueChange={(value) => field.onChange(value === 'true')}
+ defaultValue={field.value.toString()}
+ >
+ <FormItem_Shadcn_ asChild>
+ <FormControl_Shadcn_>
+ <RadioGroupStackedItem
+ value="false"
+ // @ts-ignore
+ label={
+ <>
+ Postgres
+ <Badge color="scale" className="ml-2">
+ Default
+ </Badge>
+ </>
+ }
+ description="Recommended for production workloads"
+ className="[&>div>div>p]:text-left [&>div>div>p]:text-xs"
+ />
+ </FormControl_Shadcn_>
+ </FormItem_Shadcn_>
+ <FormItem_Shadcn_ asChild>
+ <FormControl_Shadcn_>
+ <RadioGroupStackedItem
+ value="true"
+ // @ts-ignore
+ label={
+ <>
+ Postgres with OrioleDB
+ <Badge color="warning" className="ml-2">
+ Preview
+ </Badge>
+ </>
+ }
+ description="Not recommended for production workloads"
+ className={cn(
+ '[&>div>div>p]:text-left [&>div>div>p]:text-xs',
+ form.getValues('useOrioleDb') ? '!rounded-b-none' : ''
+ )}
+ />
+ </FormControl_Shadcn_>
+ </FormItem_Shadcn_>
+ </RadioGroupStacked>
+ </FormControl_Shadcn_>
+ {form.getValues('useOrioleDb') && (
+ <Admonition
+ type="warning"
+ className="rounded-t-none [&>div]:text-xs"
+ title="OrioleDB is not production ready"
+ description="Postgres with OrioleDB is currently in preview and we do not recommend using it for production."
+ >
+ <DocsButton
+ className="mt-2"
+ href="https://supabase.com/docs/guides/database/orioledb"
+ />
+ </Admonition>
+ )}
+ </FormItemLayout>
+ </>
+ )}
+ />
+
+ <p className="text-xs text-foreground-lighter text-right mt-3">
+ These settings cannot be changed after the project is created
+ </p>
+ </CollapsibleContent_Shadcn_>
+ </Collapsible_Shadcn_>
+ </Panel.Content>
+ )
+}
diff --git a/apps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsx b/apps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsx
index 0056c482d01..c0b550643b3 100644
--- a/apps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsx
+++ b/apps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsx
@@ -54,42 +54,60 @@ export const PostgresVersionSelector = ({
field,
form,
}: PostgresVersionSelectorProps) => {
- const { data, isLoading: isLoadingProjectVersions } = useProjectCreationPostgresVersionsQuery({
+ const {
+ data,
+ isLoading: isLoadingProjectVersions,
+ isSuccess,
+ } = useProjectCreationPostgresVersionsQuery({
cloudProvider,
dbRegion,
organizationSlug,
})
+ const availableVersions = (data?.available_versions ?? []).sort((a, b) =>
+ a.version.localeCompare(b.version)
+ )
useEffect(() => {
- const defaultValue = data?.available_versions?.[0]
- ? formatValue(data.available_versions[0])
- : undefined
+ const defaultValue = availableVersions[0] ? formatValue(availableVersions[0]) : undefined
form.setValue('postgresVersionSelection', defaultValue)
- }, [data, form])
+ }, [isSuccess, form])
return (
<FormItemLayout layout="horizontal" label="Postgres Version">
<Select_Shadcn_
value={field.value}
onValueChange={field.onChange}
- disabled={isLoadingProjectVersions}
+ disabled={availableVersions.length <= 1 || isLoadingProjectVersions}
>
- <SelectTrigger_Shadcn_>
+ <SelectTrigger_Shadcn_ className="[&>:nth-child(1)]:w-full [&>:nth-child(1)]:flex [&>:nth-child(1)]:items-start">
<SelectValue_Shadcn_ placeholder="Select a Postgres version for your project" />
</SelectTrigger_Shadcn_>
<SelectContent_Shadcn_>
<SelectGroup_Shadcn_>
- {(data?.available_versions || [])?.map((value) => {
- const postgresVersion = value.version.split('supabase-postgres-')[1]
+ {availableVersions.map((value) => {
+ const postgresVersion = value.version
+ .split('supabase-postgres-')[1]
+ .replace('-orioledb', '')
return (
- <SelectItem_Shadcn_ key={formatValue(value)} value={formatValue(value)}>
- <div className="flex items-center gap-3">
+ <SelectItem_Shadcn_
+ key={formatValue(value)}
+ value={formatValue(value)}
+ className="w-full [&>:nth-child(2)]:w-full"
+ >
+ <div className="flex flex-row items-center justify-between w-full">
<span className="text-foreground">{postgresVersion}</span>
- {value.release_channel !== 'ga' && (
- <Badge variant="warning" className="mr-1 capitalize">
- {value.release_channel}
- </Badge>
- )}
+ <div>
+ {value.release_channel !== 'ga' && (
+ <Badge variant="warning" className="mr-1 capitalize">
+ {value.release_channel}
+ </Badge>
+ )}
+ {value.postgres_engine.includes('oriole') && (
+ <Badge variant="default" className="mr-1">
+ OrioleDB
+ </Badge>
+ )}
+ </div>
</div>
</SelectItem_Shadcn_>
)
diff --git a/apps/studio/components/interfaces/ProjectCreation/SecurityOptions.tsx b/apps/studio/components/interfaces/ProjectCreation/SecurityOptions.tsx
new file mode 100644
index 00000000000..2e31f73e0fa
--- /dev/null
+++ b/apps/studio/components/interfaces/ProjectCreation/SecurityOptions.tsx
@@ -0,0 +1,169 @@
+import { ChevronRight } from 'lucide-react'
+import { UseFormReturn } from 'react-hook-form'
+
+import Panel from 'components/ui/Panel'
+import { CreateProjectForm } from 'pages/new/[slug]'
+import {
+ Badge,
+ cn,
+ Collapsible_Shadcn_,
+ CollapsibleContent_Shadcn_,
+ CollapsibleTrigger_Shadcn_,
+ FormControl_Shadcn_,
+ FormField_Shadcn_,
+ FormItem_Shadcn_,
+ RadioGroupStacked,
+ RadioGroupStackedItem,
+} from 'ui'
+import { Admonition } from 'ui-patterns'
+import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
+
+interface SecurityOptionsProps {
+ form: UseFormReturn<CreateProjectForm>
+}
+
+export const SecurityOptions = ({ form }: SecurityOptionsProps) => {
+ return (
+ <Panel.Content>
+ <Collapsible_Shadcn_>
+ <CollapsibleTrigger_Shadcn_ className="group/advanced-trigger font-mono uppercase tracking-widest text-xs flex items-center gap-1 text-foreground-lighter/75 hover:text-foreground-light transition data-[state=open]:text-foreground-light">
+ Security options
+ <ChevronRight
+ size={16}
+ strokeWidth={1}
+ className="mr-2 group-data-[state=open]/advanced-trigger:rotate-90 group-hover/advanced-trigger:text-foreground-light transition"
+ />
+ </CollapsibleTrigger_Shadcn_>
+ <CollapsibleContent_Shadcn_
+ className={cn(
+ 'pt-5 data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down'
+ )}
+ >
+ <FormField_Shadcn_
+ name="dataApi"
+ control={form.control}
+ render={({ field }) => (
+ <>
+ <FormItemLayout
+ layout="horizontal"
+ className="[&>div>label]:!break-normal"
+ label="What connections do you plan to use?"
+ >
+ <FormControl_Shadcn_>
+ <RadioGroupStacked
+ // Due to radio group not supporting boolean values
+ // value is converted to boolean
+ onValueChange={(value) => field.onChange(value === 'true')}
+ defaultValue={field.value.toString()}
+ >
+ <FormItem_Shadcn_ asChild>
+ <FormControl_Shadcn_>
+ <RadioGroupStackedItem
+ value="true"
+ className="[&>div>div>p]:text-left [&>div>div>p]:text-xs"
+ label="Data API + Connection String"
+ description="Connect to Postgres via autogenerated HTTP APIs or the Postgres protocol"
+ />
+ </FormControl_Shadcn_>
+ </FormItem_Shadcn_>
+ <FormItem_Shadcn_ asChild>
+ <FormControl_Shadcn_>
+ <RadioGroupStackedItem
+ label="Only Connection String"
+ value="false"
+ description="Use Postgres without the autogenerated APIs"
+ className={cn(
+ !form.getValues('dataApi') && '!rounded-b-none',
+ '[&>div>div>p]:text-left [&>div>div>p]:text-xs'
+ )}
+ onClick={() => form.setValue('useApiSchema', false)}
+ />
+ </FormControl_Shadcn_>
+ </FormItem_Shadcn_>
+ </RadioGroupStacked>
+ </FormControl_Shadcn_>
+ {!form.getValues('dataApi') && (
+ <Admonition
+ className="rounded-t-none"
+ type="warning"
+ title="Data API will effectively be disabled"
+ >
+ PostgREST which powers the Data API will have no schemas available to it.
+ </Admonition>
+ )}
+ </FormItemLayout>
+ </>
+ )}
+ />
+
+ {form.getValues('dataApi') && (
+ <FormField_Shadcn_
+ name="useApiSchema"
+ control={form.control}
+ render={({ field }) => (
+ <>
+ <FormItemLayout
+ className="mt-6"
+ layout="horizontal"
+ label="Data API Configuration"
+ >
+ <FormControl_Shadcn_>
+ <RadioGroupStacked
+ defaultValue={field.value.toString()}
+ onValueChange={(value) => field.onChange(value === 'true')}
+ >
+ <FormItem_Shadcn_ asChild>
+ <FormControl_Shadcn_>
+ <RadioGroupStackedItem
+ value="false"
+ // @ts-ignore
+ label={
+ <>
+ Use public schema for Data API
+ <Badge color="scale" className="ml-2">
+ Default
+ </Badge>
+ </>
+ }
+ // @ts-ignore
+ description={
+ <>
+ Query all tables in the <code className="text-xs">public</code>{' '}
+ schema
+ </>
+ }
+ className="[&>div>div>p]:text-left [&>div>div>p]:text-xs"
+ />
+ </FormControl_Shadcn_>
+ </FormItem_Shadcn_>
+ <FormItem_Shadcn_ asChild>
+ <FormControl_Shadcn_>
+ <RadioGroupStackedItem
+ value="true"
+ label="Use dedicated API schema for Data API"
+ // @ts-ignore
+ description={
+ <>
+ Query allowlisted tables in a dedicated{' '}
+ <code className="text-xs">api</code> schema
+ </>
+ }
+ className="[&>div>div>p]:text-left [&>div>div>p]:text-xs"
+ />
+ </FormControl_Shadcn_>
+ </FormItem_Shadcn_>
+ </RadioGroupStacked>
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ </>
+ )}
+ />
+ )}
+ <p className="text-xs text-foreground-lighter text-right mt-3">
+ These settings can be changed after the project is created via the project's settings
+ </p>
+ </CollapsibleContent_Shadcn_>
+ </Collapsible_Shadcn_>
+ </Panel.Content>
+ )
+}
diff --git a/apps/studio/components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx b/apps/studio/components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx
index eff1b6944e8..25be0511733 100644
--- a/apps/studio/components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx
+++ b/apps/studio/components/interfaces/Realtime/Inspector/NoChannelEmptyState.tsx
@@ -1,8 +1,11 @@
import { DocsButton } from 'components/ui/DocsButton'
-import { ExternalLink } from 'lucide-react'
-import { Button } from 'ui'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
+import { cn } from 'ui'
+import { Admonition } from 'ui-patterns'
const NoChannelEmptyState = () => {
+ const isOrioleDb = useIsOrioleDb()
+
return (
<div className="border bg-studio border-border rounded-md justify-start items-center flex flex-col w-10/12 relative">
<div className="w-full px-5 py-4 items-center gap-4 inline-flex border-b rounded-t-md">
@@ -14,13 +17,28 @@ const NoChannelEmptyState = () => {
</p>
</div>
</div>
- <div className="w-full px-5 py-4 items-center gap-4 inline-flex rounded-b-md">
+ <div
+ className={cn(
+ 'w-full px-5 py-4 items-center gap-4 inline-flex',
+ isOrioleDb ? '' : 'rounded-b-md'
+ )}
+ >
<div className="grow flex-col flex">
<p className="text-foreground">Not sure what to do?</p>
<p className="text-foreground-lighter text-xs">Browse our documentation</p>
</div>
<DocsButton href="https://supabase.com/docs/guides/realtime" />
</div>
+ {/* [Joshen] This is temporary as a bug was identified that might not be patched on time for release */}
+ {/* [Joshen] Just making a simple callout as this is intended to be patched soon either way, not a long term limitation */}
+ {isOrioleDb && (
+ <Admonition
+ type="warning"
+ className="mb-0 rounded-none border-0 border-t rounded-b-md [&>div]:text-xs"
+ title="Realtime database changes are not available"
+ description="This is only a temporary limitation for projects that are using Postgres with OrioleDB."
+ />
+ )}
</div>
)
}
diff --git a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
index 86f00960333..23af80059d7 100644
--- a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
+++ b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx
@@ -31,7 +31,7 @@ import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-que
import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import type { ProjectAddonVariantMeta } from 'data/subscriptions/types'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useProjectByRef } from 'hooks/misc/useSelectedProject'
+import { useIsOrioleDb, useProjectByRef } from 'hooks/misc/useSelectedProject'
import { useFlag } from 'hooks/ui/useFlag'
import { getCloudProviderArchitecture } from 'lib/cloudprovider-utils'
import { BASE_PATH, INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS } from 'lib/constants'
@@ -44,6 +44,7 @@ import CustomDomainSidePanel from './CustomDomainSidePanel'
import IPv4SidePanel from './IPv4SidePanel'
import PITRSidePanel from './PITRSidePanel'
import { NoticeBar } from 'components/interfaces/DiskManagement/ui/NoticeBar'
+import { ButtonTooltip } from 'components/ui/ButtonTooltip'
const Addons = () => {
const { resolvedTheme } = useTheme()
@@ -54,6 +55,7 @@ const Addons = () => {
const parentProject = useProjectByRef(selectedProject?.parent_project_ref)
const isBranch = parentProject !== undefined
const isProjectActive = useIsProjectActive()
+ const isOrioleDb = useIsOrioleDb()
const { data: settings } = useProjectSettingsV2Query({ projectRef })
const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: selectedOrg?.slug })
@@ -568,6 +570,20 @@ const Addons = () => {
</Button>
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
+ ) : isOrioleDb ? (
+ <ButtonTooltip
+ disabled
+ type="default"
+ className="mt-2"
+ tooltip={{
+ content: {
+ side: 'bottom',
+ text: 'Point in time recovery is not supported with OrioleDB',
+ },
+ }}
+ >
+ Change point in time recovery
+ </ButtonTooltip>
) : (
<ProjectUpdateDisabledTooltip
projectUpdateDisabled={projectUpdateDisabled}
diff --git a/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectModal.tsx b/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectModal.tsx
index 541cc223596..813397f2d52 100644
--- a/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectModal.tsx
+++ b/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectModal.tsx
@@ -76,7 +76,7 @@ const DeleteProjectModal = ({ visible, onClose }: { visible: boolean; onClose: (
return toast.error('Please select at least one reason for deleting your project')
}
- deleteProject({ projectRef: project.ref })
+ deleteProject({ projectRef: project.ref, organizationSlug: organization?.slug })
}
return (
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
index 968360b5846..fce68e7f743 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx
@@ -101,7 +101,8 @@ const DeployNewReplicaPanel = ({
const { size_gb, type, throughput_mbps, iops } = diskConfiguration?.attributes ?? {}
const showNewDiskManagementUI = diskManagementV2 && project?.cloud_provider === 'AWS'
const readReplicaDiskSizes = (size_gb ?? 0) * 1.25
- const additionalCostDiskSize = readReplicaDiskSizes * DISK_PRICING[type as DiskType]?.storage ?? 0
+ const additionalCostDiskSize =
+ readReplicaDiskSizes * (DISK_PRICING[type as DiskType]?.storage ?? 0)
const additionalCostIOPS = calculateIOPSPrice({
oldStorageType: type as DiskType,
newStorageType: type as DiskType,
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
index 6399894149f..1fca2965519 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
@@ -39,9 +39,11 @@ import { addRegionNodes, generateNodes, getDagreGraphLayout } from './InstanceCo
import { LoadBalancerNode, PrimaryNode, RegionNode, ReplicaNode } from './InstanceNode'
import MapView from './MapView'
import { RestartReplicaConfirmationModal } from './RestartReplicaConfirmationModal'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
const InstanceConfigurationUI = () => {
const reactFlow = useReactFlow()
+ const isOrioleDb = useIsOrioleDb()
const { resolvedTheme } = useTheme()
const { ref: projectRef } = useParams()
const numTransition = useRef<number>()
@@ -225,7 +227,7 @@ const InstanceConfigurationUI = () => {
<div className="flex items-center justify-center">
<ButtonTooltip
type="default"
- disabled={!canManageReplicas}
+ disabled={!canManageReplicas || isOrioleDb}
className={cn(replicas.length > 0 ? 'rounded-r-none' : '')}
onClick={() => setShowNewReplicaPanel(true)}
tooltip={{
@@ -233,7 +235,9 @@ const InstanceConfigurationUI = () => {
side: 'bottom',
text: !canManageReplicas
? 'You need additional permissions to deploy replicas'
- : undefined,
+ : isOrioleDb
+ ? 'Read replicas are not supported with OrioleDB'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx
index efaa3666ad5..a2c8d2026e6 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx
@@ -55,11 +55,14 @@ const InfrastructureInfo = () => {
const { current_app_version, current_app_version_release_channel, latest_app_version } =
data || {}
const isOnLatestVersion = current_app_version === latest_app_version
- const currentPgVersion = (current_app_version ?? '').split('supabase-postgres-')[1]
+ const currentPgVersion = (current_app_version ?? '')
+ .split('supabase-postgres-')[1]
+ ?.replace('-orioledb', '')
const isOnNonGenerallyAvailableReleaseChannel =
current_app_version_release_channel && current_app_version_release_channel !== 'ga'
? current_app_version_release_channel
: undefined
+ const isOrioleDb = (current_app_version ?? '').includes('orioledb')
const latestPgVersion = (latest_app_version ?? '').split('supabase-postgres-')[1]
const isInactive = project?.status === 'INACTIVE'
@@ -143,6 +146,23 @@ const InfrastructureInfo = () => {
</TooltipContent_Shadcn_>
</Tooltip_Shadcn_>
),
+ isOrioleDb && (
+ <>
+ <Tooltip_Shadcn_>
+ <TooltipTrigger_Shadcn_>
+ <Badge variant="default" className="mr-1">
+ OrioleDB
+ </Badge>
+ </TooltipTrigger_Shadcn_>
+ <TooltipContent_Shadcn_
+ side="bottom"
+ className="w-44 text-center"
+ >
+ This project uses OrioleDB
+ </TooltipContent_Shadcn_>
+ </Tooltip_Shadcn_>
+ </>
+ ),
isOnLatestVersion && (
<Tooltip_Shadcn_>
<TooltipTrigger_Shadcn_>
diff --git a/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx b/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
index a64d8ccff44..929345207e7 100644
--- a/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
@@ -107,6 +107,7 @@ export const ProjectPausedState = ({ product }: ProjectPausedStateProps) => {
const { data: availablePostgresVersions } = useProjectUnpausePostgresVersionsQuery({
projectRef: project?.ref,
})
+ const availableVersions = availablePostgresVersions?.available_versions || []
const hasMembersExceedingFreeTierLimit = (membersExceededLimit || []).length > 0
const [showConfirmRestore, setShowConfirmRestore] = useState(false)
@@ -322,33 +323,49 @@ export const ProjectPausedState = ({ product }: ProjectPausedStateProps) => {
render={({ field }) => (
<FormItemLayout label="Select the version of Postgres to restore to">
<FormControl_Shadcn_>
- <Select_Shadcn_ value={field.value} onValueChange={field.onChange}>
- <SelectTrigger_Shadcn_>
+ <Select_Shadcn_
+ value={field.value}
+ onValueChange={field.onChange}
+ disabled={availableVersions.length <= 1}
+ >
+ <SelectTrigger_Shadcn_ className="[&>:nth-child(1)]:w-full [&>:nth-child(1)]:flex [&>:nth-child(1)]:items-start">
<SelectValue_Shadcn_ placeholder="Select a Postgres version" />
</SelectTrigger_Shadcn_>
<SelectContent_Shadcn_>
<SelectGroup_Shadcn_>
- {(availablePostgresVersions?.available_versions || [])?.map(
- (value) => {
- const postgresVersion =
- value.version.split('supabase-postgres-')[1]
- return (
- <SelectItem_Shadcn_
- key={formatValue(value)}
- value={formatValue(value)}
- >
- <div className="flex items-center gap-3">
- <span className="text-foreground">{postgresVersion}</span>
+ {availableVersions.map((value) => {
+ const postgresVersion = value.version
+ .split('supabase-postgres-')[1]
+ ?.replace('-orioledb', '')
+ return (
+ <SelectItem_Shadcn_
+ key={formatValue(value)}
+ value={formatValue(value)}
+ className="w-full [&>:nth-child(2)]:w-full"
+ >
+ <div className="flex flex-row items-center justify-between w-full">
+ <span className="text-foreground">{postgresVersion}</span>
+ <div>
{value.release_channel !== 'ga' && (
<Badge variant="warning" className="mr-1 capitalize">
{value.release_channel}
</Badge>
)}
+ {value.postgres_engine.includes('oriole-preview') && (
+ <span>
+ <Badge variant="warning" className="mr-1">
+ OrioleDB
+ </Badge>
+ <Badge variant="warning" className="mr-1">
+ Preview
+ </Badge>
+ </span>
+ )}
</div>
- </SelectItem_Shadcn_>
- )
- }
- )}
+ </div>
+ </SelectItem_Shadcn_>
+ )
+ })}
</SelectGroup_Shadcn_>
</SelectContent_Shadcn_>
</Select_Shadcn_>
diff --git a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
index 601fd07558a..81c7849f019 100644
--- a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
@@ -114,7 +114,7 @@ const ProjectLayout = forwardRef<HTMLDivElement, PropsWithChildren<ProjectLayout
useEffect(() => {
const handler = (e: KeyboardEvent) => {
- if (e.metaKey && e.code === 'KeyI') {
+ if (e.metaKey && e.code === 'KeyI' && !e.altKey && !e.shiftKey) {
setAiAssistantPanel({ open: !open })
e.preventDefault()
e.stopPropagation()
diff --git a/apps/studio/components/ui/PasswordStrengthBar.tsx b/apps/studio/components/ui/PasswordStrengthBar.tsx
index f1c6f4cd402..b1b2b5fdc53 100644
--- a/apps/studio/components/ui/PasswordStrengthBar.tsx
+++ b/apps/studio/components/ui/PasswordStrengthBar.tsx
@@ -37,7 +37,7 @@ const PasswordStrengthBar = ({
<p>
{passwordStrengthMessage
? passwordStrengthMessage
- : 'This is the password to your postgres database, so it must be strong and hard to guess.'}{' '}
+ : 'This is the password to your Postgres database, so it must be strong and hard to guess.'}{' '}
<span
className="text-foreground opacity-50 underline hover:opacity-100 transition cursor-pointer"
onClick={generateStrongPassword}
diff --git a/apps/studio/data/auth/validate-spam-mutation.ts b/apps/studio/data/auth/validate-spam-mutation.ts
index 78a46ac777d..9b74c3becb3 100644
--- a/apps/studio/data/auth/validate-spam-mutation.ts
+++ b/apps/studio/data/auth/validate-spam-mutation.ts
@@ -7,7 +7,7 @@ import type { ResponseError } from 'types'
export type ValidateSpamVariables = {
projectRef: string
- template: components['schemas']['ValidateSpamBody']
+ template: components['schemas']['ValidateSpamBodyDto']
}
export type ValidateSpamResponse = components['schemas']['ValidateSpamResponse']
diff --git a/apps/studio/data/config/project-creation-postgres-versions-query.ts b/apps/studio/data/config/project-creation-postgres-versions-query.ts
index a54d42beb5e..119151c5587 100644
--- a/apps/studio/data/config/project-creation-postgres-versions-query.ts
+++ b/apps/studio/data/config/project-creation-postgres-versions-query.ts
@@ -31,7 +31,7 @@ export async function getPostgresCreationVersions(
})
if (error) handleError(error)
- return data as ProjectCreationPostgresVersionsResponse
+ return data
}
export type ProjectCreationPostgresVersionData = Awaited<
@@ -60,3 +60,16 @@ export const useProjectCreationPostgresVersionsQuery = <TData = ProjectCreationP
}
)
}
+
+export const useAvailableOrioleImageVersion = ({
+ cloudProvider,
+ dbRegion,
+ organizationSlug,
+}: ProjectCreationPostgresVersionsVariables) => {
+ const { data } = useProjectCreationPostgresVersionsQuery({
+ cloudProvider,
+ dbRegion,
+ organizationSlug,
+ })
+ return (data?.available_versions ?? []).find((x) => x.postgres_engine === '17-oriole')
+}
diff --git a/apps/studio/data/database/backups-query.ts b/apps/studio/data/database/backups-query.ts
index f1ebb9dde03..5c267947088 100644
--- a/apps/studio/data/database/backups-query.ts
+++ b/apps/studio/data/database/backups-query.ts
@@ -4,6 +4,7 @@ import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import type { ResponseError } from 'types'
import { databaseKeys } from './keys'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
export type BackupsVariables = {
projectRef?: string
@@ -29,9 +30,13 @@ export type BackupsError = ResponseError
export const useBackupsQuery = <TData = BackupsData>(
{ projectRef }: BackupsVariables,
{ enabled = true, ...options }: UseQueryOptions<BackupsData, BackupsError, TData> = {}
-) =>
- useQuery<BackupsData, BackupsError, TData>(
+) => {
+ // [Joshen] Check for specifically false to account for project not loaded yet
+ const isOrioleDb = useIsOrioleDb()
+
+ return useQuery<BackupsData, BackupsError, TData>(
databaseKeys.backups(projectRef),
({ signal }) => getBackups({ projectRef }, signal),
- { enabled: enabled && typeof projectRef !== 'undefined', ...options }
+ { enabled: enabled && isOrioleDb === false && typeof projectRef !== 'undefined', ...options }
)
+}
diff --git a/apps/studio/data/organizations/keys.ts b/apps/studio/data/organizations/keys.ts
index 4cd9bd10ae9..fb74eee4f15 100644
--- a/apps/studio/data/organizations/keys.ts
+++ b/apps/studio/data/organizations/keys.ts
@@ -1,5 +1,6 @@
export const organizationKeys = {
list: () => ['organizations'] as const,
+ detail: (slug?: string) => ['organizations', slug] as const,
members: (slug?: string) => ['organizations', slug, 'members'] as const,
paymentMethods: (slug: string | undefined) => ['organizations', slug, 'payment-methods'] as const,
roles: (slug: string | undefined) => ['organizations', slug, 'roles'] as const,
diff --git a/apps/studio/data/organizations/organization-query.ts b/apps/studio/data/organizations/organization-query.ts
new file mode 100644
index 00000000000..2ee9543f5be
--- /dev/null
+++ b/apps/studio/data/organizations/organization-query.ts
@@ -0,0 +1,49 @@
+import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+
+import { components } from 'api-types'
+import { get, handleError } from 'data/fetchers'
+import type { ResponseError } from 'types'
+import { organizationKeys } from './keys'
+
+export type OrganizationVariables = { slug?: string }
+export type OrganizationDetail = components['schemas']['OrganizationSlugResponse']
+
+function castOrganizationSlugResponseToOrganization(
+ org: components['schemas']['OrganizationSlugResponse']
+) {
+ return {
+ ...org,
+ billing_email: org.billing_email ?? 'Unknown',
+ managed_by: org.slug.startsWith('vercel_icfg_') ? 'vercel-marketplace' : 'supabase',
+ partner_id: org.slug.startsWith('vercel_') ? org.slug.replace('vercel_', '') : undefined,
+ }
+}
+
+export async function getOrganization({ slug }: OrganizationVariables, signal?: AbortSignal) {
+ if (!slug) throw new Error('Organization slug is required')
+
+ const { data, error } = await get('/platform/organizations/{slug}', {
+ params: { path: { slug } },
+ signal,
+ })
+ if (error) handleError(error)
+ return castOrganizationSlugResponseToOrganization(data)
+}
+
+export type OrganizationsData = Awaited<ReturnType<typeof getOrganization>>
+export type OrganizationsError = ResponseError
+
+export const useOrganizationQuery = <TData = OrganizationsData>(
+ { slug }: OrganizationVariables,
+ { enabled = true, ...options }: UseQueryOptions<OrganizationsData, OrganizationsError, TData> = {}
+) => {
+ return useQuery<OrganizationsData, OrganizationsError, TData>(
+ organizationKeys.detail(slug),
+ ({ signal }) => getOrganization({ slug }, signal),
+ { enabled: enabled && typeof slug !== 'undefined', ...options, staleTime: 30 * 60 * 1000 }
+ )
+}
+
+export function invalidateOrganizationsQuery(client: QueryClient) {
+ return client.invalidateQueries(organizationKeys.list())
+}
diff --git a/apps/studio/data/projects/project-delete-mutation.ts b/apps/studio/data/projects/project-delete-mutation.ts
index 3d298680edd..31e2a941aa2 100644
--- a/apps/studio/data/projects/project-delete-mutation.ts
+++ b/apps/studio/data/projects/project-delete-mutation.ts
@@ -4,9 +4,11 @@ import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
import type { ResponseError } from 'types'
import { projectKeys } from './keys'
+import { organizationKeys } from 'data/organizations/keys'
export type ProjectDeleteVariables = {
projectRef: string
+ organizationSlug?: string
}
export async function deleteProject({ projectRef }: ProjectDeleteVariables) {
@@ -34,8 +36,15 @@ export const useProjectDeleteMutation = ({
(vars) => deleteProject(vars),
{
async onSuccess(data, variables, context) {
- await queryClient.invalidateQueries(projectKeys.list()),
- await onSuccess?.(data, variables, context)
+ await queryClient.invalidateQueries(projectKeys.list())
+
+ if (variables.organizationSlug) {
+ queryClient.invalidateQueries(
+ organizationKeys.freeProjectLimitCheck(variables.organizationSlug)
+ )
+ }
+
+ await onSuccess?.(data, variables, context)
},
async onError(data, variables, context) {
if (onError === undefined) {
diff --git a/apps/studio/hooks/misc/useSelectedOrganization.ts b/apps/studio/hooks/misc/useSelectedOrganization.ts
index 8f82650b482..05c0276a167 100644
--- a/apps/studio/hooks/misc/useSelectedOrganization.ts
+++ b/apps/studio/hooks/misc/useSelectedOrganization.ts
@@ -4,6 +4,30 @@ import { useMemo } from 'react'
import { LOCAL_STORAGE_KEYS } from 'lib/constants'
import { useProjectByRef } from './useSelectedProject'
+import { useOrganizationQuery } from 'data/organizations/organization-query'
+
+// [Joshen] Scaffolding this first - will need to double check if this can replace useSelectedOrganization
+export function useSelectedOrganizationV2({ enabled = true } = {}) {
+ const isLoggedIn = useIsLoggedIn()
+ const { ref, slug } = useParams()
+
+ const selectedProject = useProjectByRef(ref)
+ const localStorageSlug = useMemo(() => {
+ return typeof window !== 'undefined'
+ ? localStorage.getItem(LOCAL_STORAGE_KEYS.RECENTLY_VISITED_ORGANIZATION)
+ : null
+ }, [])
+
+ const orgSlug = slug ?? selectedProject?.organization_slug ?? localStorageSlug
+ const { data } = useOrganizationQuery(
+ { slug: orgSlug as string },
+ { enabled: enabled && isLoggedIn && typeof orgSlug === 'string' }
+ )
+
+ return useMemo(() => {
+ return data
+ }, [data, slug, selectedProject, localStorageSlug])
+}
export function useSelectedOrganization({ enabled = true } = {}) {
const isLoggedIn = useIsLoggedIn()
diff --git a/apps/studio/hooks/misc/useSelectedProject.ts b/apps/studio/hooks/misc/useSelectedProject.ts
index e90ec47fbb6..4d5ebd6b6e1 100644
--- a/apps/studio/hooks/misc/useSelectedProject.ts
+++ b/apps/studio/hooks/misc/useSelectedProject.ts
@@ -21,3 +21,9 @@ export function useProjectByRef(ref?: string) {
return projects?.find((project) => project.ref === ref)
}, [projects, ref])
}
+
+export const useIsOrioleDb = () => {
+ const project = useSelectedProject()
+ const isOrioleDb = project?.dbVersion?.endsWith('orioledb')
+ return isOrioleDb
+}
diff --git a/apps/studio/pages/new/[slug].tsx b/apps/studio/pages/new/[slug].tsx
index 85f50808195..1d9d736d17a 100644
--- a/apps/studio/pages/new/[slug].tsx
+++ b/apps/studio/pages/new/[slug].tsx
@@ -1,7 +1,7 @@
import { zodResolver } from '@hookform/resolvers/zod'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { debounce } from 'lodash'
-import { ChevronRight, ExternalLink } from 'lucide-react'
+import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { PropsWithChildren, useEffect, useRef, useState } from 'react'
@@ -16,11 +16,13 @@ import {
FreeProjectLimitWarning,
NotOrganizationOwnerWarning,
} from 'components/interfaces/Organization/NewProject'
+import { AdvancedConfiguration } from 'components/interfaces/ProjectCreation/AdvancedConfiguration'
import {
PostgresVersionSelector,
extractPostgresVersionDetails,
} from 'components/interfaces/ProjectCreation/PostgresVersionSelector'
import { RegionSelector } from 'components/interfaces/ProjectCreation/RegionSelector'
+import { SecurityOptions } from 'components/interfaces/ProjectCreation/SecurityOptions'
import { WizardLayoutWithoutAuth } from 'components/layouts/WizardLayout'
import DisabledWarningDueToIncident from 'components/ui/DisabledWarningDueToIncident'
import Panel from 'components/ui/Panel'
@@ -57,16 +59,10 @@ import type { NextPageWithLayout } from 'types'
import {
Badge,
Button,
- CollapsibleContent_Shadcn_,
- CollapsibleTrigger_Shadcn_,
- Collapsible_Shadcn_,
FormControl_Shadcn_,
FormField_Shadcn_,
- FormItem_Shadcn_,
Form_Shadcn_,
Input_Shadcn_,
- RadioGroupStacked,
- RadioGroupStackedItem,
SelectContent_Shadcn_,
SelectGroup_Shadcn_,
SelectItem_Shadcn_,
@@ -79,12 +75,12 @@ import {
TableHead,
TableHeader,
TableRow,
- cn,
} from 'ui'
import { Admonition } from 'ui-patterns/admonition'
import { Input } from 'ui-patterns/DataInputs/Input'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { InfoTooltip } from 'ui-patterns/info-tooltip'
+import { useAvailableOrioleImageVersion } from 'data/config/project-creation-postgres-versions-query'
type DesiredInstanceSize = components['schemas']['DesiredInstanceSize']
@@ -101,6 +97,39 @@ const sizes: DesiredInstanceSize[] = [
'16xlarge',
]
+const FormSchema = z.object({
+ organization: z.string({
+ required_error: 'Please select an organization',
+ }),
+ projectName: z
+ .string()
+ .min(1, 'Please enter a project name.') // Required field check
+ .min(3, 'Project name must be at least 3 characters long.') // Minimum length check
+ .max(64, 'Project name must be no longer than 64 characters.'), // Maximum length check
+ postgresVersion: z.string({
+ required_error: 'Please enter a Postgres version.',
+ }),
+ dbRegion: z.string({
+ required_error: 'Please select a region.',
+ }),
+ cloudProvider: z.string({
+ required_error: 'Please select a cloud provider.',
+ }),
+ dbPassStrength: z.number(),
+ dbPass: z
+ .string({
+ required_error: 'Please enter a database password.',
+ })
+ .min(1, 'Password is required.'),
+ instanceSize: z.string(),
+ dataApi: z.boolean(),
+ useApiSchema: z.boolean(),
+ postgresVersionSelection: z.string(),
+ useOrioleDb: z.boolean(),
+})
+
+export type CreateProjectForm = z.infer<typeof FormSchema>
+
const Wizard: NextPageWithLayout = () => {
const router = useRouter()
const { slug, projectName } = useParams()
@@ -108,6 +137,7 @@ const Wizard: NextPageWithLayout = () => {
const projectCreationDisabled = useFlag('disableProjectCreationAndUpdate')
const projectVersionSelectionDisabled = useFlag('disableProjectVersionSelection')
const cloudProviderEnabled = useFlag('enableFlyCloudProvider')
+ const allowOrioleDB = useFlag('allowOrioleDb')
const { data: membersExceededLimit, isLoading: isLoadingFreeProjectLimitCheck } =
useFreeProjectLimitCheckQuery({ slug })
@@ -186,45 +216,15 @@ const Wizard: NextPageWithLayout = () => {
setPasswordStrengthMessage(message)
}
- const FormSchema = z
- .object({
- organization: z.string({
- required_error: 'Please select an organization',
- }),
- projectName: z
- .string()
- .min(1, 'Please enter a project name.') // Required field check
- .min(3, 'Project name must be at least 3 characters long.') // Minimum length check
- .max(64, 'Project name must be no longer than 64 characters.'), // Maximum length check
- postgresVersion: z.string({
- required_error: 'Please enter a Postgres version.',
- }),
- dbRegion: z.string({
- required_error: 'Please select a region.',
- }),
- cloudProvider: z.string({
- required_error: 'Please select a cloud provider.',
- }),
- dbPassStrength: z.number(),
- dbPass: z
- .string({
- required_error: 'Please enter a database password.',
- })
- .min(1, 'Password is required.'),
- instanceSize: z.string(),
- dataApi: z.boolean(),
- useApiSchema: z.boolean(),
- postgresVersionSelection: z.string(),
- })
- .superRefine(({ dbPassStrength }, refinementContext) => {
- if (dbPassStrength < DEFAULT_MINIMUM_PASSWORD_STRENGTH) {
- refinementContext.addIssue({
- code: z.ZodIssueCode.custom,
- path: ['dbPass'],
- message: passwordStrengthWarning || 'Password not secure enough',
- })
- }
- })
+ FormSchema.superRefine(({ dbPassStrength }, refinementContext) => {
+ if (dbPassStrength < DEFAULT_MINIMUM_PASSWORD_STRENGTH) {
+ refinementContext.addIssue({
+ code: z.ZodIssueCode.custom,
+ path: ['dbPass'],
+ message: passwordStrengthWarning || 'Password not secure enough',
+ })
+ }
+ })
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
@@ -241,10 +241,17 @@ const Wizard: NextPageWithLayout = () => {
dataApi: true,
useApiSchema: false,
postgresVersionSelection: '',
+ useOrioleDb: false,
},
})
- const { instanceSize } = form.watch()
+ const { instanceSize, cloudProvider, dbRegion, organization } = form.watch()
+
+ const availableOrioleVersion = useAvailableOrioleImageVersion({
+ cloudProvider: cloudProvider as CloudProvider,
+ dbRegion,
+ organizationSlug: organization,
+ })
// [kevin] This will eventually all be provided by a new API endpoint to preview and validate project creation, this is just for kaizen now
const monthlyComputeCosts =
@@ -278,8 +285,13 @@ const Wizard: NextPageWithLayout = () => {
dataApi,
useApiSchema,
postgresVersionSelection,
+ useOrioleDb,
} = values
+ if (useOrioleDb && !availableOrioleVersion) {
+ return toast.error('No available OrioleDB image found, only Postgres is available')
+ }
+
const { postgresEngine, releaseChannel } =
extractPostgresVersionDetails(postgresVersionSelection)
@@ -296,9 +308,10 @@ const Wizard: NextPageWithLayout = () => {
orgSubscription?.plan.id === 'free' ? undefined : (instanceSize as DesiredInstanceSize),
dataApiExposedSchemas: !dataApi ? [] : undefined,
dataApiUseApiSchema: !dataApi ? false : useApiSchema,
- postgresEngine: postgresEngine,
- releaseChannel: releaseChannel,
+ postgresEngine: useOrioleDb ? availableOrioleVersion?.postgres_engine : postgresEngine,
+ releaseChannel: useOrioleDb ? availableOrioleVersion?.release_channel : releaseChannel,
}
+
if (postgresVersion) {
if (!postgresVersion.match(/1[2-9]\..*/)) {
toast.error(
@@ -838,144 +851,10 @@ const Wizard: NextPageWithLayout = () => {
</Panel.Content>
)}
- <Panel.Content>
- <Collapsible_Shadcn_>
- <CollapsibleTrigger_Shadcn_ className="group/advanced-trigger font-mono uppercase tracking-widest text-xs flex items-center gap-1 text-foreground-lighter/75 hover:text-foreground-light transition data-[state=open]:text-foreground-light">
- Security options
- <ChevronRight
- size={16}
- strokeWidth={1}
- className="mr-2 group-data-[state=open]/advanced-trigger:rotate-90 group-hover/advanced-trigger:text-foreground-light transition"
- />
- </CollapsibleTrigger_Shadcn_>
- <CollapsibleContent_Shadcn_
- className={cn(
- 'pt-5 data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down'
- )}
- >
- <FormField_Shadcn_
- name="dataApi"
- control={form.control}
- render={({ field }) => (
- <>
- <FormItemLayout
- layout="horizontal"
- label="What connections do you plan to use?"
- >
- <FormControl_Shadcn_>
- <RadioGroupStacked
- // Due to radio group not supporting boolean values
- // value is converted to boolean
- onValueChange={(value) => field.onChange(value === 'true')}
- defaultValue={field.value.toString()}
- >
- <FormItem_Shadcn_ asChild>
- <FormControl_Shadcn_>
- <RadioGroupStackedItem
- value="true"
- className="[&>div>div>p]:text-left"
- label="Data API + Connection String"
- description="Connect to Postgres via autogenerated HTTP APIs or the Postgres protocol"
- />
- </FormControl_Shadcn_>
- </FormItem_Shadcn_>
- <FormItem_Shadcn_ asChild>
- <FormControl_Shadcn_>
- <RadioGroupStackedItem
- label="Only Connection String"
- value="false"
- description="Use Postgres without the autogenerated APIs"
- className={cn(
- !form.getValues('dataApi') && '!rounded-b-none'
- )}
- />
- </FormControl_Shadcn_>
- </FormItem_Shadcn_>
- </RadioGroupStacked>
- </FormControl_Shadcn_>
- {!form.getValues('dataApi') && (
- <Admonition
- className="rounded-t-none"
- type="warning"
- title="Data API will effectively be disabled"
- >
- PostgREST which powers the Data API will have no schemas
- available to it.
- </Admonition>
- )}
- </FormItemLayout>
- </>
- )}
- />
-
- {form.getValues('dataApi') && (
- <FormField_Shadcn_
- name="useApiSchema"
- control={form.control}
- render={({ field }) => (
- <>
- <FormItemLayout
- className="mt-6"
- layout="horizontal"
- label="Data API Configuration"
- >
- <FormControl_Shadcn_>
- <RadioGroupStacked
- defaultValue={field.value.toString()}
- onValueChange={(value) => field.onChange(value === 'true')}
- >
- <FormItem_Shadcn_ asChild>
- <FormControl_Shadcn_>
- <RadioGroupStackedItem
- value="false"
- // @ts-ignore
- label={
- <>
- Use public schema for Data API
- <Badge color="scale" className="ml-2">
- Default
- </Badge>
- </>
- }
- // @ts-ignore
- description={
- <>
- Query all tables in the{' '}
- <code className="text-xs">public</code> schema
- </>
- }
- />
- </FormControl_Shadcn_>
- </FormItem_Shadcn_>
- <FormItem_Shadcn_ asChild>
- <FormControl_Shadcn_>
- <RadioGroupStackedItem
- value="true"
- label="Use dedicated API schema for Data API"
- // @ts-ignore
- description={
- <>
- Query allowlisted tables in a dedicated{' '}
- <code className="text-xs">api</code> schema
- </>
- }
- />
- </FormControl_Shadcn_>
- </FormItem_Shadcn_>
- </RadioGroupStacked>
- </FormControl_Shadcn_>
- </FormItemLayout>
- </>
- )}
- />
- )}
- <p className="text-xs text-foreground-lighter text-right mt-3">
- These settings can be changed after the project is created via the
- project's settings
- </p>
- </CollapsibleContent_Shadcn_>
- </Collapsible_Shadcn_>
- </Panel.Content>
+ <SecurityOptions form={form} />
+ {allowOrioleDB && !!availableOrioleVersion && (
+ <AdvancedConfiguration form={form} />
+ )}
</>
)}
diff --git a/apps/studio/pages/project/[ref]/database/backups/pitr.tsx b/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
index 913ad9d7f74..2444dfbb623 100644
--- a/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
+++ b/apps/studio/pages/project/[ref]/database/backups/pitr.tsx
@@ -8,6 +8,7 @@ import DatabaseLayout from 'components/layouts/DatabaseLayout/DatabaseLayout'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import AlertError from 'components/ui/AlertError'
+import { DocsButton } from 'components/ui/DocsButton'
import { FormHeader } from 'components/ui/Forms/FormHeader'
import NoPermission from 'components/ui/NoPermission'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
@@ -16,9 +17,11 @@ import { useBackupsQuery } from 'data/database/backups-query'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useCheckPermissions, usePermissionsLoaded } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
import type { NextPageWithLayout } from 'types'
import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_ } from 'ui'
+import { Admonition } from 'ui-patterns'
const DatabasePhysicalBackups: NextPageWithLayout = () => {
return (
@@ -46,6 +49,7 @@ const PITR = () => {
const { ref: projectRef } = useParams()
const { project } = useProjectContext()
const organization = useSelectedOrganization()
+ const isOrioleDb = useIsOrioleDb()
const { data: backups, error, isLoading, isError, isSuccess } = useBackupsQuery({ projectRef })
const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: organization?.slug })
@@ -61,6 +65,18 @@ const PITR = () => {
return <NoPermission resourceText="view PITR backups" />
}
+ if (isOrioleDb) {
+ return (
+ <Admonition
+ type="default"
+ title="Database backups are not available for OrioleDB"
+ description="OrioleDB is currently in preview and projects created are strictly ephemeral with no database backups"
+ >
+ <DocsButton abbrev={false} className="mt-2" href="https://supabase.com/docs" />
+ </Admonition>
+ )
+ }
+
return (
<>
{isLoading && <GenericSkeletonLoader />}
diff --git a/apps/studio/pages/project/[ref]/database/backups/restore-to-new-project.tsx b/apps/studio/pages/project/[ref]/database/backups/restore-to-new-project.tsx
index 5c9d1c349c0..2dd040bb59f 100644
--- a/apps/studio/pages/project/[ref]/database/backups/restore-to-new-project.tsx
+++ b/apps/studio/pages/project/[ref]/database/backups/restore-to-new-project.tsx
@@ -14,21 +14,23 @@ import DatabaseLayout from 'components/layouts/DatabaseLayout/DatabaseLayout'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import AlertError from 'components/ui/AlertError'
+import { DocsButton } from 'components/ui/DocsButton'
import { FormHeader } from 'components/ui/Forms/FormHeader'
import NoPermission from 'components/ui/NoPermission'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import UpgradeToPro from 'components/ui/UpgradeToPro'
import { useCloneBackupsQuery } from 'data/projects/clone-query'
import { useCloneStatusQuery } from 'data/projects/clone-status-query'
+import { useProjectsQuery } from 'data/projects/projects-query'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
import { useCheckPermissions, usePermissionsLoaded } from 'hooks/misc/useCheckPermissions'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
import { getDatabaseMajorVersion } from 'lib/helpers'
import type { NextPageWithLayout } from 'types'
import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Button } from 'ui'
import { Admonition } from 'ui-patterns'
-import { useProjectsQuery } from 'data/projects/projects-query'
const RestoreToNewProjectPage: NextPageWithLayout = () => {
return (
@@ -57,6 +59,7 @@ const RestoreToNewProject = () => {
const organization = useSelectedOrganization()
const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: organization?.slug })
const isFreePlan = subscription?.plan?.id === 'free'
+ const isOrioleDb = useIsOrioleDb()
const [refetchInterval, setRefetchInterval] = useState<number | false>(false)
const [selectedBackupId, setSelectedBackupId] = useState<number | null>(null)
@@ -113,6 +116,18 @@ const RestoreToNewProject = () => {
(p) => p.ref === cloneStatus?.clones?.[0]?.target_project.ref
)
+ if (isOrioleDb) {
+ return (
+ <Admonition
+ type="default"
+ title="Restoring to new projects are not available for OrioleDB"
+ description="OrioleDB is currently in preview and projects created are strictly ephemeral with no database backups"
+ >
+ <DocsButton abbrev={false} className="mt-2" href="https://supabase.com/docs" />
+ </Admonition>
+ )
+ }
+
if (isLoading) {
return <GenericSkeletonLoader />
}
diff --git a/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx b/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx
index ee52cf9c265..dc5a35e608b 100644
--- a/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx
+++ b/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx
@@ -7,19 +7,23 @@ import DatabaseBackupsNav from 'components/interfaces/Database/Backups/DatabaseB
import DatabaseLayout from 'components/layouts/DatabaseLayout/DatabaseLayout'
import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import AlertError from 'components/ui/AlertError'
+import { DocsButton } from 'components/ui/DocsButton'
import { FormHeader } from 'components/ui/Forms/FormHeader'
import InformationBox from 'components/ui/InformationBox'
import NoPermission from 'components/ui/NoPermission'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useBackupsQuery } from 'data/database/backups-query'
import { useCheckPermissions, usePermissionsLoaded } from 'hooks/misc/useCheckPermissions'
+import { useIsOrioleDb } from 'hooks/misc/useSelectedProject'
import type { NextPageWithLayout } from 'types'
+import { Admonition } from 'ui-patterns'
const DatabaseScheduledBackups: NextPageWithLayout = () => {
const { ref: projectRef } = useParams()
const { data: backups, error, isLoading, isError, isSuccess } = useBackupsQuery({ projectRef })
+ const isOrioleDb = useIsOrioleDb()
const isPitrEnabled = backups?.pitr_enabled
const isPermissionsLoaded = usePermissionsLoaded()
@@ -33,52 +37,63 @@ const DatabaseScheduledBackups: NextPageWithLayout = () => {
<FormHeader className="!mb-0" title="Database Backups" />
<DatabaseBackupsNav active="scheduled" />
- <div className="flex flex-col gap-y-4">
- {isLoading && <GenericSkeletonLoader />}
- {isError && (
- <AlertError error={error} subject="Failed to retrieve scheduled backups" />
- )}
+ {isOrioleDb ? (
+ <Admonition
+ type="default"
+ title="Database backups are not available for OrioleDB"
+ description="OrioleDB is currently in preview and projects created are strictly ephemeral with no database backups"
+ >
+ <DocsButton abbrev={false} className="mt-2" href="https://supabase.com/docs" />
+ </Admonition>
+ ) : (
+ <div className="flex flex-col gap-y-4">
+ {isLoading && <GenericSkeletonLoader />}
- {isSuccess && (
- <>
- {!isPitrEnabled && (
- <p className="text-sm text-foreground-light">
- Projects are backed up daily around midnight of your project's region and can
- be restored at any time.
- </p>
- )}
+ {isError && (
+ <AlertError error={error} subject="Failed to retrieve scheduled backups" />
+ )}
- {isPitrEnabled && (
- <InformationBox
- hideCollapse
- defaultVisibility
- icon={<Info strokeWidth={2} />}
- title="Point-In-Time-Recovery (PITR) enabled"
- description={
- <div>
- Your project uses PITR and full daily backups are no longer taken. They're
- not needed, as PITR supports a superset of functionality, in terms of the
- granular recovery that can be performed.{' '}
- <a
- className="text-brand transition-colors hover:text-brand-600"
- href="https://supabase.com/docs/guides/platform/backups"
- >
- Learn more
- </a>
- </div>
- }
- />
- )}
+ {isSuccess && (
+ <>
+ {!isPitrEnabled && (
+ <p className="text-sm text-foreground-light">
+ Projects are backed up daily around midnight of your project's region and
+ can be restored at any time.
+ </p>
+ )}
- {isPermissionsLoaded && !canReadScheduledBackups ? (
- <NoPermission resourceText="view scheduled backups" />
- ) : (
- <BackupsList />
- )}
- </>
- )}
- </div>
+ {isPitrEnabled && (
+ <InformationBox
+ hideCollapse
+ defaultVisibility
+ icon={<Info strokeWidth={2} />}
+ title="Point-In-Time-Recovery (PITR) enabled"
+ description={
+ <div>
+ Your project uses PITR and full daily backups are no longer taken.
+ They're not needed, as PITR supports a superset of functionality, in
+ terms of the granular recovery that can be performed.{' '}
+ <a
+ className="text-brand transition-colors hover:text-brand-600"
+ href="https://supabase.com/docs/guides/platform/backups"
+ >
+ Learn more
+ </a>
+ </div>
+ }
+ />
+ )}
+
+ {isPermissionsLoaded && !canReadScheduledBackups ? (
+ <NoPermission resourceText="view scheduled backups" />
+ ) : (
+ <BackupsList />
+ )}
+ </>
+ )}
+ </div>
+ )}
</div>
</div>
</ScaffoldSection>
diff --git a/apps/studio/pages/project/[ref]/index.tsx b/apps/studio/pages/project/[ref]/index.tsx
index 34669382870..99d07bda346 100644
--- a/apps/studio/pages/project/[ref]/index.tsx
+++ b/apps/studio/pages/project/[ref]/index.tsx
@@ -12,16 +12,26 @@ import { ProjectLayoutWithAuth } from 'components/layouts/ProjectLayout/ProjectL
import { ComputeBadgeWrapper } from 'components/ui/ComputeBadgeWrapper'
import ProjectUpgradeFailedBanner from 'components/ui/ProjectUpgradeFailedBanner'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
-import { useSelectedProject } from 'hooks/misc/useSelectedProject'
+import { useIsOrioleDb, useSelectedProject } from 'hooks/misc/useSelectedProject'
import { IS_PLATFORM, PROJECT_STATUS } from 'lib/constants'
import { useAppStateSnapshot } from 'state/app-state'
import type { NextPageWithLayout } from 'types'
-import { Tabs_Shadcn_, TabsContent_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_ } from 'ui'
+import {
+ Badge,
+ Tabs_Shadcn_,
+ TabsContent_Shadcn_,
+ TabsList_Shadcn_,
+ TabsTrigger_Shadcn_,
+ Tooltip_Shadcn_,
+ TooltipContent_Shadcn_,
+ TooltipTrigger_Shadcn_,
+} from 'ui'
const Home: NextPageWithLayout = () => {
const organization = useSelectedOrganization()
const project = useSelectedProject()
+ const isOrioleDb = useIsOrioleDb()
const snap = useAppStateSnapshot()
const { enableBranching } = useParams()
@@ -44,6 +54,27 @@ const Home: NextPageWithLayout = () => {
<div className="flex items-center justify-between mx-6 space-x-6">
<div className="flex flex-row items-center gap-3">
<h1 className="text-3xl">{projectName}</h1>
+ {isOrioleDb && (
+ <Tooltip_Shadcn_>
+ <TooltipTrigger_Shadcn_>
+ <Badge variant="warning">OrioleDB</Badge>
+ </TooltipTrigger_Shadcn_>
+ <TooltipContent_Shadcn_ side="bottom" align="start" className="max-w-80 text-center">
+ This project is using Postgres with OrioleDB which is currently in preview and not
+ suitable for production workloads. View our{' '}
+ {/* [Joshen] Make this into a reusable component to use links inline */}
+ <a
+ target="_blank"
+ rel="noreferrer noopener"
+ className="underline transition underline-offset-2 decoration-foreground-lighter hover:decoration-foreground"
+ href="https://supabase.com/docs/guides/database/orioledb"
+ >
+ documentation
+ </a>{' '}
+ for all limitations.
+ </TooltipContent_Shadcn_>
+ </Tooltip_Shadcn_>
+ )}
<ComputeBadgeWrapper
project={{
ref: project?.ref,
diff --git a/apps/studio/pages/support/new.tsx b/apps/studio/pages/support/new.tsx
index 695d51e8e8e..c116e64de8b 100644
--- a/apps/studio/pages/support/new.tsx
+++ b/apps/studio/pages/support/new.tsx
@@ -3,28 +3,25 @@ import Link from 'next/link'
import { useState } from 'react'
import SVG from 'react-inlinesvg'
+import { Tooltip, TooltipContent, TooltipTrigger } from '@ui/components/shadcn/ui/tooltip'
import Success from 'components/interfaces/Support/Success'
import { SupportFormV2 } from 'components/interfaces/Support/SupportFormV2'
+import CopyButton from 'components/ui/CopyButton'
+import InformationBox from 'components/ui/InformationBox'
import { usePlatformStatusQuery } from 'data/platform/platform-status-query'
import { useProjectsQuery } from 'data/projects/projects-query'
import { withAuth } from 'hooks/misc/withAuth'
import { BASE_PATH } from 'lib/constants'
-import { Button, Tooltip_Shadcn_, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_ } from 'ui'
-import InformationBox from 'components/ui/InformationBox'
import { toast } from 'sonner'
-import { useRouter } from 'next/router'
-import { Tooltip, TooltipContent, TooltipTrigger } from '@ui/components/shadcn/ui/tooltip'
-import CopyButton from 'components/ui/CopyButton'
+import { Button, Tooltip_Shadcn_, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_ } from 'ui'
const SupportPage = () => {
const [sentCategory, setSentCategory] = useState<string>()
const [selectedProject, setSelectedProject] = useState<string>('no-project')
const { data, isLoading } = usePlatformStatusQuery()
const isHealthy = data?.isHealthy
- const router = useRouter()
- const { ref } = router.query
- const { data: projectsData, isLoading: isLoadingProjects } = useProjectsQuery()
+ const { data: projectsData } = useProjectsQuery()
return (
<div className="relative flex overflow-y-auto overflow-x-hidden">
diff --git a/packages/api-types/types/api.d.ts b/packages/api-types/types/api.d.ts
index 081229cb3ec..1e34bfb048a 100644
--- a/packages/api-types/types/api.d.ts
+++ b/packages/api-types/types/api.d.ts
@@ -317,6 +317,8 @@ export interface paths {
post: operations['OrganizationsController_createOrganizationWithTier']
}
'/platform/organizations/{slug}': {
+ /** Gets a specific organization that belongs to the authenticated user */
+ get: operations['OrganizationSlugController_getOrganization']
/** Deletes organization */
delete: operations['OrganizationSlugController_deleteOrganization']
/** Updates organization */
@@ -1195,9 +1197,13 @@ export interface paths {
/** Updates the database password */
patch: operations['DatabasePasswordController_updatePassword']
}
+ '/system/email/send': {
+ /** Send email using Postmark template */
+ post: operations['SystemEmailController_sendEmail']
+ }
'/system/github-secret-alert': {
- /** Reset JWT if leaked keys found by GitHub secret scanning */
- post: operations['GithubSecretAlertController_resetJwt']
+ /** Respond to GitHub secret scanning webhook request */
+ post: operations['GithubSecretAlertController_githubSecretScanningEndpoint']
}
'/system/health': {
/** Get API health status */
@@ -1499,6 +1505,8 @@ export interface paths {
post: operations['OrganizationsController_createOrganizationWithTier']
}
'/v0/organizations/{slug}': {
+ /** Gets a specific organization that belongs to the authenticated user */
+ get: operations['OrganizationSlugController_getOrganization']
/** Deletes organization */
delete: operations['OrganizationSlugController_deleteOrganization']
/** Updates organization */
@@ -3597,6 +3605,7 @@ export interface components {
query: string
}
FunctionResponse: {
+ compute_multiplier?: number
/** Format: int64 */
created_at: number
entrypoint_path?: string
@@ -3604,7 +3613,6 @@ export interface components {
import_map?: boolean
import_map_path?: string
name: string
- resource_multiplier?: string
slug: string
/** @enum {string} */
status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'
@@ -3614,6 +3622,7 @@ export interface components {
version: number
}
FunctionSlugResponse: {
+ compute_multiplier?: number
/** Format: int64 */
created_at: number
entrypoint_path?: string
@@ -3621,7 +3630,6 @@ export interface components {
import_map?: boolean
import_map_path?: string
name: string
- resource_multiplier?: string
slug: string
/** @enum {string} */
status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'
@@ -4429,20 +4437,55 @@ export interface components {
name: string
project_ids: number[] | null
}
- OrganizationSlugAvailableVersionsBody: {
+ OrganizationSlugAvailableVersionsBodyDto: {
provider: string
region: string
}
OrganizationSlugAvailableVersionsResponse: {
available_versions: components['schemas']['ProjectCreationVersionInfo'][]
}
+ OrganizationSlugProject: {
+ cloud_provider: string
+ disk_volume_size_gb?: number
+ engine?: string
+ id: number
+ /** @enum {string} */
+ infra_compute_size?:
+ | 'nano'
+ | 'micro'
+ | 'small'
+ | 'medium'
+ | 'large'
+ | 'xlarge'
+ | '2xlarge'
+ | '4xlarge'
+ | '8xlarge'
+ | '12xlarge'
+ | '16xlarge'
+ inserted_at: string | null
+ is_branch_enabled: boolean
+ is_physical_backups_enabled: boolean | null
+ name: string
+ organization_id: number
+ organization_slug: string
+ preview_branch_refs: string[]
+ ref: string
+ region: string
+ status: string
+ subscription_id: string | null
+ }
OrganizationSlugResponse: {
- billing_email?: string
+ billing_email: string | null
+ billing_metadata?: Record<string, never>
+ has_oriole_project: boolean
id: number
name: string
opt_in_tags: string[]
+ projects: components['schemas']['OrganizationSlugProject'][]
+ restriction_data: unknown
+ /** @enum {string|null} */
+ restriction_status: 'grace_period' | 'grace_period_over' | 'restricted' | null
slug: string
- stripe_customer_id?: string
}
OrgDocumentUrlResponse: {
fileUrl: string
@@ -4640,7 +4683,7 @@ export interface components {
work_mem?: string
}
/** @enum {string} */
- PostgresEngine: '15'
+ PostgresEngine: '15' | '17-oriole'
PostgresExtension: {
comment: string | null
default_version: string
@@ -5199,7 +5242,7 @@ export interface components {
target_table_schema: string
}
/** @enum {string} */
- ReleaseChannel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn'
+ ReleaseChannel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'
RemoveNetworkBanRequest: {
ipv4_addresses: string[]
}
@@ -5442,6 +5485,16 @@ export interface components {
team?: string
title: string
}
+ SendEmailBodyDto: {
+ addresses: string[]
+ custom_properties: {
+ [key: string]: unknown
+ }
+ template_alias: string
+ }
+ SendEmailResponseBodyDto: {
+ message: string
+ }
SendExitSurveyBody: {
additionalFeedback?: string
exitAction?: string
@@ -5730,7 +5783,7 @@ export interface components {
db_pass: string
db_pass_supabase: string
jwt_secret: string
- /** @description Name of your project, should not contain dots */
+ /** @description Name of your project */
name: string
/** @description Slug of your organization */
organization_id: string
@@ -6416,10 +6469,19 @@ export interface components {
UpdateNotificationsBodyV1: {
ids: string[]
}
- UpdateOrganizationBody: {
- billing_email: string
+ UpdateOrganizationBodyDto: {
+ /** Format: email */
+ billing_email?: string
+ name?: string
+ opt_in_tags: 'AI_SQL_GENERATOR_OPT_IN'[]
+ }
+ UpdateOrganizationResponse: {
+ billing_email?: string
+ id: number
name: string
opt_in_tags: string[]
+ slug: string
+ stripe_customer_id?: string
}
UpdatePasswordBody: {
password: string
@@ -6813,8 +6875,8 @@ export interface components {
}
V1CreateFunctionBody: {
body: string
+ compute_multiplier?: number
name: string
- resource_multiplier?: string
slug: string
verify_jwt?: boolean
}
@@ -6838,7 +6900,7 @@ export interface components {
* @description This field is deprecated and is ignored in this request
*/
kps_enabled?: boolean
- /** @description Name of your project, should not contain dots */
+ /** @description Name of your project */
name: string
/** @description Slug of your organization */
organization_id: string
@@ -6852,7 +6914,7 @@ export interface components {
* @description Postgres engine version. If not provided, the latest version will be used.
* @enum {string}
*/
- postgres_engine?: '15'
+ postgres_engine?: '15' | '17-oriole'
/**
* @description Region you want your server to reside in
* @enum {string}
@@ -6880,7 +6942,7 @@ export interface components {
* @description Release channel. If not provided, GA will be used.
* @enum {string}
*/
- release_channel?: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn'
+ release_channel?: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'
/**
* Format: uri
* @description Template URL used to create the project from the CLI.
@@ -7038,8 +7100,8 @@ export interface components {
}
V1UpdateFunctionBody: {
body?: string
+ compute_multiplier?: number
name?: string
- resource_multiplier?: string
verify_jwt?: boolean
}
ValidateQueryBody: {
@@ -7048,7 +7110,7 @@ export interface components {
ValidateQueryResponse: {
valid: boolean
}
- ValidateSpamBody: {
+ ValidateSpamBodyDto: {
content: string
subject: string
}
@@ -7773,7 +7835,7 @@ export interface operations {
ValidateController_validateSpam: {
requestBody: {
content: {
- 'application/json': components['schemas']['ValidateSpamBody']
+ 'application/json': components['schemas']['ValidateSpamBodyDto']
}
}
responses: {
@@ -8663,11 +8725,25 @@ export interface operations {
}
}
}
+ /** Gets a specific organization that belongs to the authenticated user */
+ OrganizationSlugController_getOrganization: {
+ parameters: {
+ path: {
+ slug: string
+ }
+ }
+ responses: {
+ 200: {
+ content: {
+ 'application/json': components['schemas']['OrganizationSlugResponse']
+ }
+ }
+ }
+ }
/** Deletes organization */
OrganizationSlugController_deleteOrganization: {
parameters: {
path: {
- /** @description Organization slug */
slug: string
}
}
@@ -8688,19 +8764,18 @@ export interface operations {
OrganizationSlugController_updateOrganization: {
parameters: {
path: {
- /** @description Organization slug */
slug: string
}
}
requestBody: {
content: {
- 'application/json': components['schemas']['UpdateOrganizationBody']
+ 'application/json': components['schemas']['UpdateOrganizationBodyDto']
}
}
responses: {
200: {
content: {
- 'application/json': components['schemas']['OrganizationSlugResponse']
+ 'application/json': components['schemas']['UpdateOrganizationResponse']
}
}
/** @description Failed to update organization */
@@ -8742,13 +8817,12 @@ export interface operations {
OrganizationSlugController_getAvailableImageVersions: {
parameters: {
path: {
- /** @description Organization slug */
slug: string
}
}
requestBody: {
content: {
- 'application/json': components['schemas']['OrganizationSlugAvailableVersionsBody']
+ 'application/json': components['schemas']['OrganizationSlugAvailableVersionsBodyDto']
}
}
responses: {
@@ -14771,25 +14845,26 @@ export interface operations {
}
}
}
- /** Reset JWT if leaked keys found by GitHub secret scanning */
- GithubSecretAlertController_resetJwt: {
- parameters: {
- header: {
- 'github-public-key-identifier': string
- 'github-public-key-signature': string
- }
- }
+ /** Send email using Postmark template */
+ SystemEmailController_sendEmail: {
requestBody: {
content: {
- 'application/json': string
+ 'application/json': components['schemas']['SendEmailBodyDto']
}
}
responses: {
- 200: {
- content: never
+ /** @description Email queued successfully */
+ 201: {
+ content: {
+ 'application/json': components['schemas']['SendEmailResponseBodyDto']
+ }
}
- /** @description Failed to reset JWT */
- 500: {
+ }
+ }
+ /** Respond to GitHub secret scanning webhook request */
+ GithubSecretAlertController_githubSecretScanningEndpoint: {
+ responses: {
+ 200: {
content: never
}
}
@@ -15383,7 +15458,7 @@ export interface operations {
import_map?: boolean
entrypoint_path?: string
import_map_path?: string
- resource_multiplier?: string
+ compute_multiplier?: number
}
path: {
/** @description Project ref */
@@ -15464,7 +15539,7 @@ export interface operations {
import_map?: boolean
entrypoint_path?: string
import_map_path?: string
- resource_multiplier?: string
+ compute_multiplier?: number
}
path: {
/** @description Project ref */
@@ -17400,7 +17475,7 @@ export interface operations {
'v1-get-a-snippet': {
parameters: {
path: {
- id: Record<string, never>
+ id: string
}
}
responses: {