The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
[wip] feat: add support for additional AWS regions (#28806)
Div Arorafada3c03919b
diff --git a/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx b/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsxindex e50e7346d84..245b265dfff 100644--- a/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx+++ b/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx@@ -2,7 +2,9 @@ import { useRouter } from 'next/router'import { ControllerRenderProps, UseFormReturn } from 'react-hook-form'import { useDefaultRegionQuery } from 'data/misc/get-default-region-query'+import { useFlag } from 'hooks/ui/useFlag'import { PROVIDERS } from 'lib/constants'+import type { CloudProvider } from 'shared-data'import {SelectContent_Shadcn_,SelectGroup_Shadcn_,@@ -12,7 +14,6 @@ import {Select_Shadcn_,} from 'ui'import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'-import type { CloudProvider } from 'shared-data'import { getAvailableRegions } from './ProjectCreation.utils'interface RegionSelectorProps {@@ -21,13 +22,23 @@ interface RegionSelectorProps {form: UseFormReturn<any>}+// [Joshen] Let's use a library to maintain the flag SVGs in the future+// I tried using https://flagpack.xyz/docs/development/react/ but couldn't get it to render+// ^ can try again next time+export const RegionSelector = ({ cloudProvider, field }: RegionSelectorProps) => {const router = useRouter()+ const newRegions = ['EAST_US_2', 'WEST_EU_3', 'CENTRAL_EU_2', 'NORTH_EU']+ const enableNewRegions = useFlag('enableNewRegions')+const showNonProdFields =process.env.NEXT_PUBLIC_ENVIRONMENT === 'local' ||process.env.NEXT_PUBLIC_ENVIRONMENT === 'staging'const availableRegions = getAvailableRegions(PROVIDERS[cloudProvider].id)+ const regionsArray = enableNewRegions+ ? Object.entries(availableRegions)+ : Object.entries(availableRegions).filter(([key]) => !newRegions.includes(key))const { isLoading: isLoadingDefaultRegion } = useDefaultRegionQuery({cloudProvider,@@ -56,15 +67,15 @@ export const RegionSelector = ({ cloudProvider, field }: RegionSelectorProps) =></SelectTrigger_Shadcn_><SelectContent_Shadcn_><SelectGroup_Shadcn_>- {Object.keys(availableRegions).map((option: string, i) => {- const label = Object.values(availableRegions)[i].displayName as string+ {regionsArray.map(([key, value]) => {+ const label = value.displayName as stringreturn (- <SelectItem_Shadcn_ key={option} value={label}>+ <SelectItem_Shadcn_ key={key} value={label}><div className="flex items-center gap-3"><imgalt="region icon"className="w-5 rounded-sm"- src={`${router.basePath}/img/regions/${Object.keys(availableRegions)[i]}.svg`}+ src={`${router.basePath}/img/regions/${key}.svg`}/><span className="text-foreground">{label}</span></div>diff --git a/apps/studio/public/img/regions/CENTRAL_EU_2.svg b/apps/studio/public/img/regions/CENTRAL_EU_2.svgnew file mode 100644index 00000000000..65be7b4fa7a--- /dev/null+++ b/apps/studio/public/img/regions/CENTRAL_EU_2.svg@@ -0,0 +1,9 @@+<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-ch" viewBox="0 0 640 480">+ <g fill-rule="evenodd" stroke-width="1pt">+ <path fill="red" d="M0 0h640v480H0z"/>+ <g fill="#fff">+ <path d="M170 195h300v90H170z"/>+ <path d="M275 90h90v300h-90z"/>+ </g>+ </g>+</svg>\ No newline at end of filediff --git a/apps/studio/public/img/regions/EAST_US_2.svg b/apps/studio/public/img/regions/EAST_US_2.svgnew file mode 100644index 00000000000..3189d8e2dc3--- /dev/null+++ b/apps/studio/public/img/regions/EAST_US_2.svg@@ -0,0 +1,10 @@+<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-us" viewBox="0 0 640 480">+ <g fill-rule="evenodd">+ <g stroke-width="1pt">+ <path fill="#bd3d44" d="M0 0h972.8v39.4H0zm0 78.8h972.8v39.4H0zm0 78.7h972.8V197H0zm0 78.8h972.8v39.4H0zm0 78.8h972.8v39.4H0zm0 78.7h972.8v39.4H0zm0 78.8h972.8V512H0z" transform="scale(.9375)"/>+ <path fill="#fff" d="M0 39.4h972.8v39.4H0zm0 78.8h972.8v39.3H0zm0 78.7h972.8v39.4H0zm0 78.8h972.8v39.4H0zm0 78.8h972.8v39.4H0zm0 78.7h972.8v39.4H0z" transform="scale(.9375)"/>+ </g>+ <path fill="#192f5d" d="M0 0h389.1v275.7H0z" transform="scale(.9375)"/>+ <path fill="#fff" d="M32.4 11.8 36 22.7h11.4l-9.2 6.7 3.5 11-9.3-6.8-9.2 6.7 3.5-10.9-9.3-6.7H29zm64.9 0 3.5 10.9h11.5l-9.3 6.7 3.5 11-9.2-6.8-9.3 6.7 3.5-10.9-9.2-6.7h11.4zm64.8 0 3.6 10.9H177l-9.2 6.7 3.5 11-9.3-6.8-9.2 6.7 3.5-10.9-9.3-6.7h11.5zm64.9 0 3.5 10.9H242l-9.3 6.7 3.6 11-9.3-6.8-9.3 6.7 3.6-10.9-9.3-6.7h11.4zm64.8 0 3.6 10.9h11.4l-9.2 6.7 3.5 11-9.3-6.8-9.2 6.7 3.5-10.9-9.2-6.7h11.4zm64.9 0 3.5 10.9h11.5l-9.3 6.7 3.6 11-9.3-6.8-9.3 6.7 3.6-10.9-9.3-6.7h11.5zM64.9 39.4l3.5 10.9h11.5L70.6 57 74 67.9l-9-6.7-9.3 6.7L59 57l-9-6.7h11.4zm64.8 0 3.6 10.9h11.4l-9.3 6.7 3.6 10.9-9.3-6.7-9.3 6.7L124 57l-9.3-6.7h11.5zm64.9 0 3.5 10.9h11.5l-9.3 6.7 3.5 10.9-9.2-6.7-9.3 6.7 3.5-10.9-9.2-6.7H191zm64.8 0 3.6 10.9h11.4l-9.3 6.7 3.6 10.9-9.3-6.7-9.2 6.7 3.5-10.9-9.3-6.7H256zm64.9 0 3.5 10.9h11.5L330 57l3.5 10.9-9.2-6.7-9.3 6.7 3.5-10.9-9.2-6.7h11.4zM32.4 66.9 36 78h11.4l-9.2 6.7 3.5 10.9-9.3-6.8-9.2 6.8 3.5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 11-9.2-6.8-9.3 6.7 3.5-10.9-9.2-6.7H191zm64.8 0 3.6 10.9h11.4l-9.2 6.7 3.5 11-9.3-6.8-9.2 6.7 3.5-10.9-9.3-6.7H256zm64.9 0 3.5 10.9h11.5l-9.3 6.7 3.5 11-9.2-6.8-9.3 6.7 3.5-10.9-9.2-6.7h11.4zM32.4 232.4l3.6 10.9h11.4l-9.2 6.7 3.5 10.9-9.3-6.7-9.2 6.7 3.5-11-9.3-6.7H29zm64.9 0 3.5 10.9h11.5L103 250l3.6 10.9-9.3-6.7-9.3 6.7 3.6-11-9.3-6.7h11.4zm64.8 0 3.6 10.9H177l-9 6.7 3.5 10.9-9.3-6.7-9.2 6.7 3.5-11-9.3-6.7h11.5zm64.9 0 3.5 10.9H242l-9.3 6.7 3.6 10.9-9.3-6.7-9.3 6.7 3.6-11-9.3-6.7h11.4zm64.8 0 3.6 10.9h11.4l-9.2 6.7 3.5 10.9-9.3-6.7-9.2 6.7 3.5-11-9.2-6.7h11.4zm64.9 0 3.5 10.9h11.5l-9.3 6.7 3.6 10.9-9.3-6.7-9.3 6.7 3.6-11-9.3-6.7h11.5z" transform="scale(.9375)"/>+ </g>+</svg>diff --git a/apps/studio/public/img/regions/NORTH_EU.svg b/apps/studio/public/img/regions/NORTH_EU.svgnew file mode 100644index 00000000000..5d82e9f5f82--- /dev/null+++ b/apps/studio/public/img/regions/NORTH_EU.svg@@ -0,0 +1,4 @@+<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-se" viewBox="0 0 640 480">+ <path fill="#005293" d="M0 0h640v480H0z"/>+ <path fill="#fecb00" d="M176 0v192H0v96h176v192h96V288h368v-96H272V0z"/>+</svg>\ No newline at end of filediff --git a/apps/studio/public/img/regions/WEST_EU_3.svg b/apps/studio/public/img/regions/WEST_EU_3.svgnew file mode 100644index 00000000000..deb14284ba4--- /dev/null+++ b/apps/studio/public/img/regions/WEST_EU_3.svg@@ -0,0 +1,5 @@+<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-fr" viewBox="0 0 640 480">+ <path fill="#fff" d="M0 0h640v480H0z"/>+ <path fill="#000091" d="M0 0h213.3v480H0z"/>+ <path fill="#e1000f" d="M426.7 0H640v480H426.7z"/>+</svg>\ No newline at end of filediff --git a/packages/shared-data/regions.ts b/packages/shared-data/regions.tsindex d006f1a6382..d4cd259c8df 100644--- a/packages/shared-data/regions.ts+++ b/packages/shared-data/regions.ts@@ -4,10 +4,14 @@ export type Region = typeof AWS_REGIONS | typeof FLY_REGIONSexport const AWS_REGIONS = {WEST_US: { code: 'us-west-1', displayName: 'West US (North California)' },EAST_US: { code: 'us-east-1', displayName: 'East US (North Virginia)' },+ EAST_US_2: { code: 'us-east-2', displayName: 'East US (Ohio)' },CENTRAL_CANADA: { code: 'ca-central-1', displayName: 'Canada (Central)' },WEST_EU: { code: 'eu-west-1', displayName: 'West EU (Ireland)' },WEST_EU_2: { code: 'eu-west-2', displayName: 'West EU (London)' },+ WEST_EU_3: { code: 'eu-west-3', displayName: 'West EU (Paris)' },CENTRAL_EU: { code: 'eu-central-1', displayName: 'Central EU (Frankfurt)' },+ CENTRAL_EU_2: { code: 'eu-central-2', displayName: 'Central Europe (Zurich)' },+ NORTH_EU: { code: 'eu-north-1', displayName: 'North EU (Stockholm)'},SOUTH_ASIA: { code: 'ap-south-1', displayName: 'South Asia (Mumbai)' },SOUTHEAST_ASIA: { code: 'ap-southeast-1', displayName: 'Southeast Asia (Singapore)' },NORTHEAST_ASIA: { code: 'ap-northeast-1', displayName: 'Northeast Asia (Tokyo)' },